Channel acquisition circuit of digital quantity input signal
By designing a digital input signal acquisition circuit including optocoupler, resistor and general input and output interface, the problem of high cost, complex structure and difficult to meet high safety performance requirements in the prior art is solved, and low cost is achieved , high-security digital input signal acquisition effect.
Patent Information
- Application Number
- CN202411416748.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-07
AI Technical Summary
The existing digital input signal acquisition circuit has high cost and complex structure, making it difficult to meet high safety performance requirements.
A channel acquisition circuit including an optocoupler, resistor and general input and output interface is designed. The digital input signal is converted into an optical signal through the optocoupler and then converted into an electrical signal. The on-state of the optocoupler is controlled by using the resistor. and input current to ensure that the circuit can still operate normally when a single resistor fails.
Reduces circuit costs, simplifies the circuit structure, realizes a design that meets high safety performance requirements, and ensures that the circuit can still work normally in the event of a failure.
Smart Images

Figure CN119396039A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial automation technology, and in particular to a channel acquisition circuit for digital quantity input signals. Background Art
[0002] With the rapid development of the industrial automation industry, the application of miniaturized programmable logic controllers (PLCs) has become increasingly widespread, bringing new demands for functional safety performance. Especially in the context of meeting the International Electrotechnical Commission standard IEC 61131:2017, the requirements for functional safety digital input (DI) signal acquisition circuits have become more stringent. This requirement not only involves the reliability of the circuit, but also includes the ability to maintain safety functions when a single device fails.
[0003] However, existing channel acquisition circuits have some problems in design and implementation, such as high cost, complex circuit structure, and difficulty in achieving designs that meet high safety performance requirements. These problems limit the application of functional safety DI signal acquisition circuits in miniaturized PLCs and hinder the further development of industrial automation systems. Therefore, there is an urgent need for a new DI signal acquisition circuit solution that meets high safety standards and solves existing technical problems. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a channel acquisition circuit for a digital input signal to solve the problems of the prior art, such as high cost, complex circuit structure, and difficulty in meeting high safety performance requirements.
[0005] The embodiment of the present application provides a channel acquisition circuit for a digital input signal, comprising: an optical coupler, a resistor and a universal input / output interface; the optical coupler is used to convert the digital input signal into an optical signal according to an internal current transfer rate and a forward conduction voltage when receiving the digital input signal, and then convert the optical signal into an electrical signal; the resistor comprises a series resistor and a parallel resistor, the series resistor is used to limit the current flowing to the optical coupler to control the conduction state of the optical coupler; the parallel resistor is used to adjust the input current of the optical coupler to control the optical coupler to be turned on or off within a predetermined voltage range, and when a single resistor fails, the threshold level when the single resistor fails is evaluated to determine whether the circuit is operating normally; the universal input / output interface is used to connect the optical coupler, receive the electrical signal converted by the optical coupler, determine the state of the digital input signal according to the level change of the electrical signal, and acquire the digital input signal according to the state of the digital input signal.
[0006] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
[0007] Through optocouplers, resistors and universal input and output interfaces; optocouplers are used to convert digital input signals into optical signals according to the internal current transfer rate and forward conduction voltage when receiving digital input signals, and then convert the optical signals into electrical signals; resistors include series resistors and parallel resistors, and the series resistors are used to limit the current flowing to the optocoupler to control the conduction state of the optocoupler; parallel resistors are used to adjust the input current of the optocoupler to control the optocoupler to be turned on or off within a predetermined voltage range, and when a single resistor fails, the threshold level when a single resistor fails is evaluated to determine whether the circuit is operating normally; universal input and output interfaces are used to connect optocouplers, receive electrical signals converted by optocouplers, and determine the state of digital input signals according to the level changes of electrical signals, and collect digital input signals according to the state of digital input signals. This application reduces circuit costs, has a simple circuit structure, and achieves a design that meets high safety performance requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0009] Figure 1 It is a structural schematic diagram of a channel acquisition circuit for a digital quantity input signal provided in an embodiment of the present application;
[0010] Figure 2 It is a flowchart of a method for calculating a shutdown voltage value provided in an embodiment of the present application;
[0011] Figure 3 It is a flowchart of the on-state voltage value calculation method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0012] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0013] It should be understood that the terms "comprises", "comprising" or any other variations thereof used herein are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprising..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0014] It should be noted that the term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description. The concepts of "first", "second", etc. mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0015] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0016] In view of the problems existing in the above-mentioned background technology, the present application provides a new channel acquisition circuit for digital input signals. This scheme aims to realize the effective and safe acquisition of DI (digital input) signals through a specific circuit design. The key components of this scheme include an optocoupler, multiple resistors and a general input and output interface (i.e., GPIO pin). The circuit design complies with the IEC 61131-2:2017 standard, especially the Type 3 requirement, to ensure that the circuit can still work normally even when a single resistor fails. Among them, the optocoupler is the core component in the circuit, which is used to convert electrical signals into optical signals and then convert them back into electrical signals. This conversion isolates the input and output and improves the safety of the circuit. The resistor is used to limit the current flowing to the optocoupler to ensure that the optocoupler is within a safe and effective working range. When the optocoupler is turned on, the state of the processor GPIO pin (i.e., general input and output interface) changes from a high level to a low level, thereby realizing the acquisition of DI signals.
[0017] The working principle of the channel acquisition circuit of this application may include the following:
[0018] Turn-on characteristic: Use the turn-on characteristic of the optocoupler (CTR*IF≥IC) to ensure that the optocoupler can conduct normally when receiving sufficient input current.
[0019] Consideration of temperature effects: The CTR value (current transfer rate) of the optocoupler will change with temperature, so the change in the CTR value at the maximum operating temperature needs to be considered during design.
[0020] Calculate the minimum CTR value: By consulting the optocoupler manual, you can get the typical CTR value under specific conditions. Then adjust this value according to the actual operating conditions (such as temperature and current) to estimate the minimum CTR value.
[0021] Forward voltage (Vf): The forward voltage of the optocoupler LED when it is turned on is also an important parameter that needs to be considered when designing the circuit.
[0022] The product structure involved in the actual scenario of the channel acquisition circuit of the digital input signal of the present application is explained below in conjunction with the accompanying drawings. Figure 1 is a schematic diagram of the structure of a channel acquisition circuit for a digital quantity input signal provided in an embodiment of the present application, such as Figure 1 As shown, the channel acquisition circuit of the digital input signal may specifically include the following contents:
[0023] Optocouplers, resistors, and general purpose input and output interfaces;
[0024] The optical coupler is used to convert the digital input signal into an optical signal and then convert the optical signal into an electrical signal according to the internal current transfer rate and forward conduction voltage when receiving the digital input signal;
[0025] Resistors, including series resistors and parallel resistors, the series resistors are used to limit the current flowing to the optocoupler to control the on-state of the optocoupler; the parallel resistors are used to adjust the input current of the optocoupler to control the optocoupler to be on or off within a predetermined voltage range, and when a single resistor fails, the threshold level when the single resistor fails is evaluated to determine whether the circuit is operating normally;
[0026] The universal input / output interface is used to connect the optocoupler, receive the electrical signal converted by the optocoupler, determine the state of the digital input signal according to the level change of the electrical signal, and collect the digital input signal according to the state of the digital input signal.
[0027] First, the meanings of the technical terms involved in the technical solution of this application in actual scenarios are explained in detail, which may include the following:
[0028] 1) DI signal: Digital input signal, that is, digital input signal.
[0029] 2) Processor GPIO pins refer to the "General Purpose Input / Output" pins of the processor. In the embodiments of this application, they are called "general purpose input / output interfaces" or "general purpose input / output ports". GPIO pins are very important components of microcontrollers or processors. They can be programmed to input or output various electrical signals to interact with external circuits or devices. The application of GPIO pins in this solution includes the following:
[0030] When the optocoupler is turned on (i.e., receives a DI signal), it causes the voltage state of the GPIO pin connected to the optocoupler to change. Specifically, when the optocoupler is turned on, the state of this GPIO pin changes from a high level (when there is no signal) to a low level (when there is a signal). This change is recognized by the processor, realizing the acquisition of the DI signal.
[0031] It should be noted that the functions of GPIO pins are not fixed, but can be programmed and configured as needed to make them input ports or output ports. For example, they can be used for a variety of purposes such as reading sensor signals (input) or controlling LED lights (output).
[0032] 3) The CTR value refers to the "Current Transfer Ratio". In the embodiment of the present application, it can also be called the "current transfer rate" or "current conversion rate". CTR is an important parameter in the optocoupler (a photoelectric device), which indicates the current conversion efficiency from the input end to the output end. It is expressed as a percentage of the ratio of the input current (IF) to the output current (IC), that is, CTR = (IC / IF) × 100%. The CTR value is crucial to the performance of the optocoupler because it directly affects the signal strength that the optocoupler can effectively transmit. The application of CTR in this solution includes the following:
[0033] In the embodiments of the present application, the CTR value is used to calculate and ensure that the optocoupler can be reliably turned on or off under different operating conditions (such as different temperatures and currents). The CTR value of the optocoupler may change with changes in operating conditions (such as temperature, input current, etc.), so these factors need to be considered when designing the circuit to ensure the correct and safe operation of the circuit.
[0034] In short, the CTR value is a key parameter to measure the performance of the optocoupler, which indicates the efficiency of the optocoupler in converting input current to output current. In circuit design, the appropriate CTR value is one of the important factors to ensure the normal operation of the circuit.
[0035] Combine the following Figure 1The circuit diagram shown and the embodiments under specific application scenarios provide a detailed description of the DI signal acquisition process and principle of the channel acquisition circuit of the digital input signal of the present application in actual application scenarios, which may specifically include the following contents:
[0036] The channel acquisition circuit of the present application utilizes the conduction characteristic CTR*IF≥IC of the optocoupler and uses the optocoupler for sampling. The redundant design of multiple resistors at the acquisition end is to ensure that the conduction requirement voltage value after a single resistor fails can still meet the digital quantity acquisition voltage and current threshold range required by Type 3 in standard IEC 61131-2:2017.
[0037] The DI signal turns on U1 through R1, R2, and R3, and the acquisition state of the corresponding GPIO pin of the processor changes from high level to low level, completing the acquisition of the DI signal. U1 uses a high-speed optical coupler, the purpose of which is to have a faster response time when acquiring level-type signals. Taking the high-speed optical coupler HCPL-M453 as a calculation example, there is a CTR typical value of 24% under the conditions of Ta = 25°C / If = 16mA in the optical coupler manual. This indicates that for this model of optical coupler, under the conditions of Ta = 25°C / If = 16mA, the CTR is a certain value of 24%. Use this value as the parameter of the optical coupler itself; for example, taking 25°C as the benchmark, assuming that the highest temperature of the application scenario is 60°C when other conditions remain unchanged, it can be seen that the CTR at 60°C is about 0.9 times that at 25 degrees, which is the smallest CTR in this temperature range.
[0038] Therefore, under the condition of 16mA / (-20~60℃), the minimum CTR value of the optocoupler HCPL-M453 is 24%*0.9=21.6%; if the actual If is 5mA, how to determine the minimum CTR value of CTR under the condition of If=5mA / (-20~60℃). According to the relationship between the optocoupler's If and CTR, it can be found that the CTR is about 1 when If=16mA, and about 0.8 when If=5mA. 5mA is 0.8 / 1=0.8 times of 16mA; therefore, under the condition of If=5mA / (-20~60℃), the minimum CTR value of the optocoupler HC PL-M453 is 21.6%*0.8=17.8%. The forward conduction voltage Vf of the optocoupler, when If is 5mA, the forward voltage of the optocoupler LED is about 1.5V when it is turned on.
[0039] It can be seen that the channel acquisition circuit design of the digital input signal of the present application ensures that normal operation can be maintained even when some components fail, thereby meeting the requirements of functional safety.
[0040] In some embodiments, according to the internal current transfer rate and the forward conduction voltage, the digital input signal is converted into an optical signal, and the optical signal is converted into an electrical signal, including:
[0041] The internal circuit of the optocoupler adjusts the input current according to the voltage level of the digital input signal and the preset current transfer rate to control the luminous intensity of the light-emitting diode in the optocoupler;
[0042] The photosensitive element in the optical coupler receives the light signal from the light-emitting diode and converts the light signal into an output current of corresponding intensity;
[0043] The forward voltage of the optocoupler is used to determine the input voltage required when the optocoupler is turned on and off.
[0044] Specifically, the channel acquisition circuit is suitable for miniaturized programmable logic controllers (PLCs) in industrial automation systems. The core of this embodiment is to use a high-performance optical coupler, which converts digital input signals into optical signals based on the internal current transfer rate (CTR) and forward conduction voltage (Vf), and then converts the optical signals into electrical signals.
[0045] Furthermore, the internal circuit of the optocoupler is designed to adjust the input current (IF) according to the voltage level of the digital input signal and the preset current transfer rate. This adjustment mechanism allows the light intensity of the light-emitting diode (LED) to be precisely controlled, thereby ensuring the quality and consistency of the optical signal.
[0046] Furthermore, the optocoupler is equipped with a photosensitive element, such as a phototransistor or a photodiode. These elements receive the light signal from the light-emitting diode and convert it into an output current (IC) of corresponding intensity. The size of the output current depends not only on the intensity of the light signal, but also closely related to the current transfer rate (CTR).
[0047] Furthermore, the optocoupler’s forward voltage (Vf) is used to determine the input voltage threshold required for the optocoupler to turn on and off. This function ensures that the optocoupler can reliably perform signal conversion at the set voltage level.
[0048] In practical applications, when a digital input signal (such as a signal from a sensor or control unit) is applied to the circuit, the optocoupler first responds to the voltage level of the input signal. According to the preset CTR value, the internal circuit of the optocoupler adjusts the input current IF, thereby controlling the luminous intensity of the LED. The light signal emitted by the LED is captured by the photosensitive element and converted into a current signal IC. The output current IC is then transmitted to the general input and output interface and converted into a digital signal for further processing by the PLC or other automation equipment.
[0049] In some embodiments, the series resistor is used to:
[0050] When the optocoupler receives input current, the current limiting resistance value of the series resistor is calculated according to the preset initial voltage and query current, and the resistance value corresponding to each resistor in the series resistor is determined by using the current limiting resistance value according to the number of resistors in the series resistor.
[0051] Specifically, the series resistor acts as a current limiting resistor in the circuit of the present application, and its main function is to control the current flowing to the optocoupler to protect the optocoupler from damage caused by excessive current and ensure the normal operation of the entire circuit.
[0052] In one example, according to the design requirements, the current limiting resistor needs to ensure that the current is around 5mA to meet the working requirements of the optocoupler. In the specific calculation, if the preset initial voltage is 24V and the forward conduction voltage of the optocoupler is 1.5V, the calculation formula of the current limiting resistor is: R1 = (V1-Vf) / I1 = (24V-1.5V) / 5mA = 4.5KΩ.
[0053] Therefore, in order to achieve a current limiting resistance value of 4.5KΩ, three 1.6KΩ resistors can be selected and used in series, because the total resistance of three 1.6KΩ resistors in series is 4.8KΩ, which is close to the calculated 4.5KΩ.
[0054] In the above example, the specific calculation process of the current limiting resistor value is as follows:
[0055] When designing the circuit, first determine the required current limiting current (5mA), then calculate the required total current limiting resistor value based on the formula and the preset voltage. For example, set a power supply voltage (V1) to 24V, the on-voltage (Vf) of the optocoupler to 1.5V, and the query current (I1) to 5mA.
[0056] Next, the theoretical value of the current limiting resistor is calculated using the formula R1 = (V1-Vf) / I1. In the above formula (24V-1.5V) / 5mA = 4.5KΩ, the 1.5V is subtracted because this part of the voltage will be consumed by the optocoupler.
[0057] Finally, select the appropriate resistance value based on the calculation results. In this application example, three 1.6KΩ resistors are selected in series to approach the required current limiting resistance value, that is, 1.6KΩ x 3 = 4.8KΩ. The selected resistors are connected in series, and then this group of resistors is integrated into the channel acquisition circuit of the digital input signal to ensure that the current is properly limited when flowing to the optocoupler.
[0058] In some embodiments, the series resistor is used to:
[0059] The power corresponding to each resistor in the series resistor is derated using a preset derated coefficient, and the actual power corresponding to each resistor in the series resistor is determined according to the power corresponding to each resistor in the series resistor obtained after the derated processing.
[0060] Specifically, the embodiment of the present application also provides a method for derating the power of the series resistor in the channel acquisition circuit of the digital input signal. The method aims to ensure that the resistor element in the circuit can work stably for a long time under different power supply voltages while avoiding damage due to overheating or overload.
[0061] Furthermore, the power derating method of the series resistor includes the following contents:
[0062] Perform power calculations for each series resistor in the circuit, ensuring that the theoretical power drawn by each resistor is calculated for the given supply voltage.
[0063] Apply the derating factor to each resistor and calculate its actual power under derating conditions. This step is to improve the reliability and safety of the circuit.
[0064] The specification of the resistor is selected according to the actual power. In this embodiment, the selected resistor should be able to withstand a power higher than 0.15W to ensure that the resistor will not be damaged due to power overload during long-term operation.
[0065] In one example, at a power supply voltage of 36V, the power calculation formula for a single 1.6KΩ resistor is P=V^2 / R. Therefore, P=(36V)^2 / 1600Ω=0.09W. In order to ensure the long-term stability and safety of the resistor, this embodiment adopts a derating factor of 0.6. This means that the actual operating power of the resistor should be less than 60% of its maximum rated power.
[0066] Further, based on the derating factor and the initial power calculation, the actual power is 0.09W*0.6=0.15W. According to the actual power obtained after the power derating process, the specification of the resistor is selected. In this embodiment, a 1.6KΩ 1 / 5W resistor with a 0402 package is selected.
[0067] Through the method of the above embodiment, the present application ensures that the electrical parameters of each component in the circuit operate within a certain safety range. In the above embodiment, by reasonably calculating and selecting the resistor, the circuit can operate stably under different power supply voltages, while also protecting the optical coupler from damage by excessive current.
[0068] In some embodiments, a parallel resistor is used to:
[0069] The initial input current of the optocoupler is calculated according to the forward conduction voltage of the optocoupler and the preset parallel resistance value; the initial output current of the optocoupler is calculated according to the current transfer rate and the initial input current; and the pull-up resistance of the universal input / output interface is determined according to the initial output current.
[0070] Specifically, the parallel resistor acts as a shunt resistor in this circuit, and its main function is to ensure that the optocoupler is reliably turned on or off within a specific voltage range. The shunt resistor achieves this function by regulating the input current (IF) flowing to the optocoupler.
[0071] The initial input current of the optocoupler is calculated based on the forward voltage (Vf) of the optocoupler and the preset shunt resistor value. Then, the initial output current of the optocoupler is calculated based on the current transfer ratio (CTR) of the optocoupler and the initial input current. The initial output current is used to determine the pull-up resistor (Rc) of the universal input and output interface connected to the optocoupler. The pull-up resistor is essential to maintain a stable level at the output of the optocoupler.
[0072] The following is a detailed description of the calculation process of the pull-up resistor with a specific example, which may include the following contents:
[0073] First, select and calculate the shunt resistor, and choose a shunt resistor value in the range of 5-11V (1.2KΩ in this example). Then, select three 3.48KΩ resistors in parallel, and the actual shunt resistor value is 1.16KΩ.
[0074] Next, the input current and output current are calculated, and the input current IF of the photocoupler is calculated when the minimum threshold Vf = 11 V. Then, the output current IC is calculated based on the CTR value.
[0075] Then, determine the required pull-up resistor value. In this example, a 24KΩ pull-up resistor is selected. At the same time, ensure that the logic low level Vol (0.4V) output by the optocoupler is sufficiently lower than the voltage low threshold Vil (0.66V) of the microcontroller unit (MCU) sampling GPIO to ensure signal reliability.
[0076] The parameter calculation process involved in the calculation process of the pull-up resistor provided in the above specific example is described in detail below, which may specifically include the following contents:
[0077] It is necessary to ensure that the optocoupler is reliably turned off in the range of 0-5V and reliably turned on in the range of 11-30V. Therefore, the value is selected in the range of 5-11V. Here, 1.2KΩ is selected. In addition, this resistor can adjust IF to make the optocoupler work in the switching state. Three shunt resistors are connected in parallel. In fact, three 3.48K are selected in parallel. The shunt resistor value after parallel connection is 1.16K. According to the power calculation of Vf, 0402, 1 / 16W is selected.
[0078] When the minimum threshold VF = 11V, IF = i1-i2 = (11V-1.4V) / 4.8KΩ-1.4V / 1.16KΩ = 0.793mA. The corresponding CTR is calculated according to the method in the previous section, which can be calculated as 17.8%. In order to satisfy the optical coupler working in the switching state, IF*CTR>IC is required. 0.793mA*17.8%=0.141mA. It is approximately considered that Ic<0.141mA is required.
[0079] The pull-up resistor Rc from the optocoupler to the processor's GPIO is 24KΩ. According to the optocoupler's data sheet, the optocoupler output logic low level Vol is 0.4V. Ic=(3.3V-0.4V) / 24KΩ=0.12mA<0.141mA. This satisfies the requirement of IF*CTR>IC. In addition, Vol needs to be lower than Vi l (3.3V*0.2=0.66V) of the MCU's acquisition GPIO to ensure that the optocoupler can reliably output a low level and be acquired by the processor.
[0080] Through the method of the above embodiment, the selection and calculation of the shunt resistor is based on the working state (on or off) of the optocoupler at different voltage levels, and ensures that the current output by the optocoupler in the on state meets specific requirements. This sophisticated calculation method ensures the reliability and functional safety of the circuit.
[0081] Figure 2 is a flow chart of the method for calculating the turn-off voltage value provided in the embodiment of the present application. Figure 2 As shown, the calculation process of the turn-off voltage value may include the following contents:
[0082] S201, calculating the input current of the optocoupler according to the initial output current of the optocoupler and the maximum current transfer rate of the optocoupler;
[0083] S202, querying the forward conduction voltage corresponding to the input current according to the relationship curve between the input current and the forward conduction voltage of the optical coupler;
[0084] S203, calculating the current value of the parallel resistor according to the forward conduction voltage corresponding to the input current, and adding the current value of the parallel resistor to the input current of the optocoupler to obtain the current value of the series resistor;
[0085] S204, calculate the voltage value of the series resistor according to the current value and resistance value of the series resistor, add the voltage value of the series resistor to the forward conduction voltage, obtain the first voltage threshold corresponding to the digital input signal when the optocoupler is turned off, and use the first voltage threshold as the turn-off voltage value.
[0086] Specifically, according to the application requirements, select a suitable optocoupler and determine its maximum CTR value and forward conduction voltage. Calculate the input and output current values of the optocoupler to ensure that the input current does not exceed the maximum tolerance of the optocoupler. Combine the values of the series resistor and the parallel resistor to calculate the turn-off voltage of the optocoupler.
[0087] The calculation process of the turn-off voltage value is described in detail below with reference to a specific example, which may specifically include the following contents:
[0088] First, the input current (If) of the optocoupler is calculated based on the initial output current (Ic) and the maximum current transfer rate (CTR) of the optocoupler. For example, under the condition of Ic=0.12mA and the maximum CTR is 50%, If should not exceed 0.24mA.
[0089] Next, the forward conduction voltage corresponding to the input current is queried using the relationship curve between the input current and the forward conduction voltage (Vf) of the optical coupler. In this embodiment, when If=0.24mA, Vf is approximately 1.38V.
[0090] Next, calculate the current flowing through the parallel resistors. In this example, 1.38V divided by the total resistance of the parallel resistors, 1.16KΩ, gives a current of approximately 1.19mA.
[0091] Finally, the current value of the series resistor (obtained by adding the current of the parallel resistor and the input current) is multiplied by the total resistance value of the series resistor, and then the forward conduction voltage is added to calculate the turn-off voltage value. In this embodiment, the turn-off voltage Voff = 1.38V + (1.19mA*4.8KΩ) = 7.09V, which is higher than the turn-off threshold of 5V.
[0092] By using the method of the above embodiment, more accurate signal acquisition and processing can be achieved by accurately controlling the input and output currents of the optocoupler. In addition, this method helps to improve the overall performance and stability of the system, especially in an environment with large voltage fluctuations. By reasonably calculating the shutdown voltage, the reliability and safety of the circuit under various working conditions can be ensured, thereby reducing the system failure rate and improving the long-term stable operation of the system.
[0093] Figure 3 is a flow chart of the on-state voltage value calculation method provided in the embodiment of the present application. Figure 3 As shown, the calculation process of the on-state voltage value may include the following contents:
[0094] S301, calculating the input current of the optocoupler according to the initial output current of the optocoupler and the minimum current transfer rate of the optocoupler;
[0095] S302, querying the forward conduction voltage corresponding to the input current according to the relationship curve between the input current and the forward conduction voltage of the optical coupler;
[0096] S303, calculating the current value of the parallel resistor according to the forward conduction voltage corresponding to the input current, and adding the current value of the parallel resistor to the input current of the optocoupler to obtain the current value of the series resistor;
[0097] S304, calculate the voltage value of the series resistor according to the current value and resistance value of the series resistor, add the voltage value of the series resistor to the forward conduction voltage, obtain the second voltage threshold corresponding to the digital input signal when the optocoupler is saturated and turned on, and use the second voltage threshold as the turn-on voltage value.
[0098] Specifically, according to the application requirements, select a suitable optocoupler and determine its minimum CTR value and forward conduction voltage. Calculate the input and output current values of the optocoupler to ensure that the input current meets the minimum CTR requirements of the optocoupler. Combine the values of the series resistor and the parallel resistor to calculate the conduction voltage of the optocoupler.
[0099] The calculation process of the on-state voltage value is described in detail below with reference to a specific example, which may specifically include the following contents:
[0100] First, the input current (If) of the optocoupler is calculated based on the initial output current (Ic) and the minimum current transfer ratio (CTR) of the optocoupler. For example, under the conditions of Ic=0.12mA and the minimum CTR is 17.8%, If needs to be greater than or equal to 0.67mA.
[0101] Next, the forward conduction voltage corresponding to the input current is queried using the relationship curve between the input current and the forward conduction voltage (Vf) of the optical coupler. In this embodiment, when If is greater than 1.5V, Vf is approximately 1.4V.
[0102] Next, calculate the current flowing through the parallel resistors. In this example, 1.4V divided by the total resistance of the parallel resistors, 1.16KΩ, gives a current of approximately 1.21mA.
[0103] Finally, the current value of the series resistor (obtained by adding the current of the parallel resistor and the input current) is multiplied by the total resistance value of the series resistor, and then added to the forward conduction voltage to calculate the conduction voltage value. In this embodiment, the conduction voltage Von = 1.4V + (1.21mA + 0.67mA) * 4.8KΩ = 10.4V, which is lower than the conduction threshold of 11V.
[0104] By using the method of the above embodiment, more accurate signal acquisition and processing can be achieved by accurately controlling the input and output currents of the optocoupler. In addition, this method helps to improve the overall performance and stability of the system, especially in an environment with large voltage fluctuations. By reasonably calculating the on-voltage, the reliability and safety of the circuit under various working conditions can be ensured, thereby reducing the system failure rate and improving the long-term stable operation of the system.
[0105] In some embodiments, a threshold level when a single resistor fails is evaluated to determine whether the circuit operates normally, including:
[0106] When a single resistor fails, the turn-off voltage and the turn-on voltage corresponding to the series resistor, as well as the turn-off voltage and the turn-on voltage corresponding to the parallel resistor are calculated respectively; when the turn-off voltage and the turn-on voltage are both within the voltage range formed by the first voltage threshold and the second voltage threshold, it is determined that the circuit is in a normal operating state.
[0107] Specifically, when a single resistor in a circuit fails (such as short circuit or open circuit), it is necessary to evaluate whether the off voltage (Voff) and on voltage (Von) of the circuit still meet the preset threshold range. The following is a detailed description of the threshold level evaluation process when a single resistor fails, combined with a specific example and a resistor failure evaluation table, which may specifically include the following:
[0108] When one of the three 1.6KΩ resistors in series is short-circuited, the resistance value changes from 4.8KΩ to 3.2KΩ. At this time:
[0109] Von=1.4V+((1.4V / 1.16KΩ)mA+0.6mA)*3.2KΩ=7.192V<11V;
[0110] Voff=1.38V+(1.4V / 1.74KΩ)mA*3.2KΩ=5.188V>5V, meeting the requirements.
[0111] The resistance of the three 3.6KΩ resistors in parallel changes from 1.16KΩ to 1.74KΩ after one of them is disconnected. At this time:
[0112] Von=1.4V+((1.4V / 1.74KΩ)mA+0.6mA)*4.8KΩ=8.142V<11V;
[0113] Voff=1.35+(1.4V / 1.74KΩ)mA*4.8KΩ=5.212V>5V, meeting the requirements.
[0114] Table 1 Resistance failure evaluation table
[0115]
[0116]
[0117] In the above example, when one of the 1.6KΩ resistors in the series resistors is shorted, the total resistance changes from 4.8KΩ to 3.2KΩ. Calculate the off-voltage and on-voltage at this time to ensure that they meet the circuit requirements.
[0118] In another example, when one of the 3.48KΩ resistors in the parallel resistors is disconnected, the total resistance changes from 1.16KΩ to 1.74KΩ. Similarly, calculate the off-voltage and on-voltage to ensure that they are within the predetermined range.
[0119] That is, when the series resistor fails, the calculation results of the turn-off voltage Voff are 5.188 V and 5.212 V, both higher than the minimum turn-off threshold of 5 V. When the series resistor fails, the calculation results of the turn-on voltage Von are 7.192 V and 8.142 V, both lower than the minimum turn-on threshold of 11 V.
[0120] In some embodiments, judging the state of the digital input signal according to the level change of the electrical signal, and collecting the digital input signal according to the state of the digital input signal includes:
[0121] When the level of the electrical signal changes from a high level to a low level, it is determined that the digital input signal is in the input state, the optical coupler is turned on, and the digital input signal is collected;
[0122] When the level of the electrical signal changes from a low level to a high level, it is determined that the digital input signal is in a disconnected state, and the optocoupler is turned off.
[0123] Specifically, the system is designed to monitor the level changes of electrical signals. In particular, the system focuses on the transition of electrical signals from high level to low level, and from low level to high level. When the level of the electrical signal changes from high level to low level, the system determines that the digital input signal is in the input state. This usually means that the external device or sensor has been activated or sent a signal.
[0124] Furthermore, in the input state, the optocoupler is turned on. This means that the light-emitting diode inside the optocoupler begins to emit light, activating the photosensitive element and causing it to generate a current of corresponding intensity. When the optocoupler is turned on, the state of the general-purpose input and output (GPIO) pin connected to it changes from a high level (indicating a no-signal state) to a low level (indicating a signal state). The processor recognizes this change and implements the acquisition of digital input signals accordingly.
[0125] On the contrary, when the level of the electrical signal changes from low level to high level, the system determines that the digital input signal is in the disconnected state. At this time, the optocoupler is turned off and the GPIO pin returns to the high level state, indicating that there is no input signal.
[0126] In some embodiments, the series resistor is formed by connecting three resistors in series, and the parallel resistor is formed by connecting three resistors in parallel.
[0127] Specifically, the channel acquisition circuit of the present application includes three series resistors and three parallel resistors, thereby realizing a redundant design of multiple resistors, so that when some components (such as a single resistor) fail, the circuit can still maintain normal operation, ensuring the reliability and stability of the circuit. It should be noted that the number of the above-mentioned series resistors and parallel resistors does not constitute a limitation on the technical solution of the present application, and those skilled in the art can select an appropriate number of series resistors and parallel resistors according to the actual scenario requirements.
[0128] According to the technical solution provided in the embodiments of the present application, the technical solution of the present application has at least the following advantages:
[0129] Through the precise control of the optocoupler, the circuit can quickly and accurately identify the state change of the digital input signal (such as the transition from high level to low level), thereby achieving instant response and accurate acquisition of the input signal. This feature is particularly important for automated control systems that need to respond quickly to external events.
[0130] The design of series and parallel resistors allows the circuit to maintain normal operation even if a single resistor fails, ensuring the stability and reliability of the system. This design improves the fault tolerance of the circuit and reduces the risk of system failure caused by component failure.
[0131] This technical solution reduces the reliance on complex and expensive components by simplifying the circuit design, thereby reducing the overall cost. At the same time, this design also improves the maintainability and scalability of the circuit, providing convenience for future upgrades.
[0132] The circuit can adapt to different environmental conditions, such as temperature changes, and maintain its performance and accuracy. This robust design enables the circuit to operate reliably in a variety of industrial environments and is particularly suitable for applications in extreme or changing environments.
[0133] The circuit design of this solution takes into account compatibility with existing systems and can be easily integrated into various industrial control systems. In addition, the implementation of this technical solution does not require large-scale transformation of existing systems, making upgrades and deployments simpler and more economical.
[0134] In summary, the technical solution of the present application not only improves the accuracy and reliability of digital input signal acquisition, but also optimizes cost and maintainability, and is very suitable for the needs of modern industrial automation and control systems.
[0135] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A channel acquisition circuit for a digital input signal, characterized in that: include: Optocouplers, resistors, and general purpose input and output interfaces; The optical coupler is used to convert the digital input signal into an optical signal and then convert the optical signal into an electrical signal according to the internal current transmission rate and forward conduction voltage when receiving the digital input signal; The resistor comprises a series resistor and a parallel resistor, wherein the series resistor is used to limit the current flowing to the optical coupler to control the conduction state of the optical coupler; the parallel resistor is used to adjust the input current of the optical coupler to control the optical coupler to be turned on or off within a predetermined voltage range, and when a single resistor fails, the threshold level when the single resistor fails is evaluated to determine whether the circuit is operating normally; The universal input / output interface is used to connect the optical coupler, receive the electrical signal converted by the optical coupler, determine the state of the digital input signal according to the level change of the electrical signal, and collect the digital input signal according to the state of the digital input signal.
2. The circuit according to claim 1, characterized in that The method of converting the digital input signal into an optical signal according to the internal current transmission rate and the forward conduction voltage, and converting the optical signal into an electrical signal, comprises: The internal circuit of the optical coupler adjusts the input current according to the voltage level of the digital input signal and the preset current transfer rate to control the luminous intensity of the light emitting diode in the optical coupler; The photosensitive element in the optical coupler receives the light signal of the light emitting diode and converts the light signal into an output current of corresponding intensity; The forward conduction voltage of the optocoupler is used to determine the input voltage required when the optocoupler is turned on and off.
3. The circuit according to claim 1, characterized in that The series resistor is used to: When the optocoupler receives an input current, the current limiting resistance value of the series resistor is calculated according to a preset initial voltage and a query current, and the resistance value corresponding to each resistor in the series resistor is determined using the current limiting resistance value according to the number of resistors in the series resistor.
4. The circuit according to claim 3, characterized in that The series resistor is used to: The power corresponding to each resistor in the series resistors is derated using a preset derated coefficient, and the actual power corresponding to each resistor in the series resistors is determined according to the power corresponding to each resistor in the series resistors obtained after the derated processing.
5. The circuit according to claim 1, characterized in that The parallel resistor is used to: Calculating an initial input current of the optocoupler according to the forward conduction voltage of the optocoupler and a preset parallel resistance value; calculating an initial output current of the optocoupler according to the current transfer rate and the initial input current; A pull-up resistor of the universal input / output interface is determined according to the initial output current.
6. The circuit according to claim 5, characterized in that The optocoupler is used to: Calculating the input current of the optocoupler according to the initial output current of the optocoupler and the maximum current transfer rate of the optocoupler; According to the relationship curve between the input current and the forward conduction voltage of the optical coupler, querying the forward conduction voltage corresponding to the input current; Calculating the current value of the parallel resistor according to the forward conduction voltage corresponding to the input current, and adding the current value of the parallel resistor to the input current of the optocoupler to obtain the current value of the series resistor; According to the current value and resistance value of the series resistor, the voltage value of the series resistor is calculated, and the voltage value of the series resistor is added to the forward conduction voltage to obtain a first voltage threshold corresponding to the digital input signal when the optocoupler is turned off, and the first voltage threshold is used as the shutdown voltage value.
7. The circuit according to claim 6, characterized in that The optocoupler is used to: Calculating the input current of the optocoupler according to the initial output current of the optocoupler and the minimum current transfer rate of the optocoupler; According to the relationship curve between the input current and the forward conduction voltage of the optical coupler, querying the forward conduction voltage corresponding to the input current; Calculating the current value of the parallel resistor according to the forward conduction voltage corresponding to the input current, and adding the current value of the parallel resistor to the input current of the optocoupler to obtain the current value of the series resistor; According to the current value and resistance value of the series resistor, the voltage value of the series resistor is calculated, and the voltage value of the series resistor is added to the forward conduction voltage to obtain a second voltage threshold corresponding to the digital input signal when the optocoupler is saturated and turned on, and the second voltage threshold is used as the conduction voltage value.
8. The circuit according to claim 1, characterized in that The step of evaluating the threshold level when a single resistor fails to determine whether the circuit is operating normally includes: When a single resistor fails, the turn-off voltage and the turn-on voltage corresponding to the series resistor, as well as the turn-off voltage and the turn-on voltage corresponding to the parallel resistor are calculated respectively; when the turn-off voltage and the turn-on voltage are both within the voltage range formed by the first voltage threshold and the second voltage threshold, it is judged that the circuit is in a normal operating state.
9. The circuit according to claim 1, characterized in that The step of judging the state of the digital quantity input signal according to the level change of the electrical signal, and collecting the digital quantity input signal according to the state of the digital quantity input signal comprises: When the level of the electrical signal changes from a high level to a low level, it is determined that the digital input signal is in an input state, the optical coupler is turned on, and the digital input signal is collected; When the level of the electrical signal changes from a low level to a high level, it is determined that the digital input signal is in a disconnected state, and the optical coupler is turned off.
10. The circuit according to claim 1, characterized in that The series resistor is formed by connecting three resistors in series, and the parallel resistor is formed by connecting three resistors in parallel.
Citation Information
Cited By
Circuit structure suitable for analog optocoupler and electronic equipment
CN121907230A
Circuit structure suitable for analog optical coupling and electronic device
CN121907230B