Signal conversion circuit
By introducing the first comparison circuit and the driving circuit into the signal conversion circuit, the on-off of the acquisition conversion circuit is quickly controlled, and the protection failure problem caused by untimely control of the MCU is solved, and the safety and reliability of the circuit are improved.
Patent Information
- Application Number
- CN202510014182.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-04-18
AI Technical Summary
In the prior art, the MCU code judgment time is too long or the MCU program cannot jump in time at a certain high-level interruption, resulting in the MOSFET being on and off in an out-of-control state, causing the pin to be shorted to 32V, and causing the resistor to burn rapidly due to the dissipation of 5.12W.
A signal conversion circuit is adopted, including a first comparison circuit, a driving circuit and an acquisition conversion circuit. The hardware circuit of the first comparison circuit is quickly controlled to prevent protection failure caused by untimely control of the MCU.
The safety of the acquisition and conversion circuit is improved, the probability of burning due to untimely protection is reduced, and the reliability of the signal conversion circuit is ensured.
Smart Images

Figure CN119853665A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power electronics, and more specifically, relates to a signal conversion circuit. Background Art
[0002] In order to improve the reliability of the signal and avoid the attenuation of the signal due to the long wiring harness, long-distance sensors for trucks usually use current sensors, such as 4-20mA pressure and temperature sensors, and 7-14mA current square wave speed sensors. In order to effectively collect sensor signals inside the electronic control unit ECU, the corresponding current / voltage conversion needs to be performed for the current input.
[0003] At present, a MOSFET is connected in series in the path as a switch, and the pin voltage of the sensor current entering the ECU is monitored by the MCU. When the pin voltage exceeds a certain threshold, the MCU controls the MOSFET to turn off, thereby protecting the ECU pin-related components.
[0004] However, if the MCU code judgment time is too long, or the MCU program cannot jump to execute other codes in time during a high-level interrupt, or the MCU is in a program runaway state, the on and off of the MOSFET used for protection is out of control. At this time, if the pin is short-circuited to 32V, the resistor used for current / voltage conversion will quickly burn out due to the 5.12W power dissipation. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a signal conversion circuit, which can be used to protect the acquisition and conversion circuit through MCU protection or through a first comparison circuit. The first comparison circuit is a hardware circuit with a fast processing speed and can quickly control the acquisition and conversion circuit to shut down.
[0006] The present application discloses a signal conversion circuit, comprising: a first comparison circuit, a driving circuit and a collection conversion circuit;
[0007] The first end of the acquisition conversion circuit is connected to the output pin of the current type sensor and the output end of the signal conversion circuit respectively;
[0008] The second end of the acquisition conversion circuit is grounded;
[0009] The first input terminal of the first comparison circuit is connected to the output pin of the current type sensor;
[0010] The second input terminal of the first comparison circuit is connected to a power supply;
[0011] The first input terminal of the driving circuit is connected to the output terminal of the first comparison circuit;
[0012] The second input terminal of the driving circuit receives the control signal of the MCU; the input terminal of the MCU is connected to the output pin of the current type sensor through a first resistor;
[0013] The output end of the driving circuit is connected to the control end of the acquisition conversion circuit;
[0014] When the output current of the current type sensor is higher than a preset current, the output signal of the first comparison circuit indicates that the acquisition conversion circuit is controlled to be shut down; and when at least one of the output signal of the first comparison circuit and the control signal of the MCU indicates that the acquisition conversion circuit is controlled to be shut down, the drive circuit controls the acquisition conversion circuit to be shut down.
[0015] Optionally, when the output signal of the first comparison circuit and the control signal of the MCU both indicate to control the acquisition conversion circuit to be closed, the driving circuit controls the acquisition conversion circuit to be closed.
[0016] Optionally, the first comparison circuit includes: a second resistor, a third resistor, a fourth resistor, a fifth resistor and a first comparator;
[0017] One end of the second resistor serves as a first input end of the first comparison circuit;
[0018] The other end of the second resistor is connected to one end of the third resistor and the negative input end of the first comparator respectively;
[0019] One end of the fourth resistor serves as a second input end of the first comparison circuit;
[0020] The other end of the fifth resistor is connected to one end of the fifth resistor and the positive input end of the first comparator respectively;
[0021] The other end of the fifth resistor and the other end of the third resistor are both grounded;
[0022] The output end of the first comparator serves as the output end of the first comparison circuit.
[0023] Optionally, the driving circuit includes: an AND gate and an eighth resistor;
[0024] The first input terminal of the AND gate serves as the first input terminal of the driving circuit;
[0025] The second input terminal of the AND gate serves as the second input terminal of the driving circuit;
[0026] The output end of the AND gate is connected to one end of the eighth resistor, and the connection point serves as the output end of the driving circuit;
[0027] The other end of the eighth resistor is grounded.
[0028] Optionally, the acquisition conversion circuit includes: a switch tube, a sixth resistor, a seventh resistor and a ninth resistor;
[0029] One end of the switch tube is connected to one end of the sixth resistor and one end of the ninth resistor respectively;
[0030] The other end of the switch tube is respectively connected to one end of the seventh resistor and the other end of the ninth resistor;
[0031] The control end of the switch tube serves as the control end of the acquisition conversion circuit;
[0032] The other end of the sixth resistor serves as the first end of the acquisition conversion circuit;
[0033] The other end of the seventh resistor serves as the second end of the acquisition conversion circuit.
[0034] Optionally, it also includes: a signal amplification circuit;
[0035] The input end of the signal amplifying circuit is respectively connected to the output pin of the current type sensor and the first end of the acquisition conversion circuit;
[0036] The output end of the signal amplifying circuit is connected to the output end of the signal converting circuit.
[0037] Optionally, the signal amplifying circuit comprises: an operational amplifier, a gain circuit and an eleventh resistor;
[0038] One end of the eleventh resistor is grounded;
[0039] The other end of the eleventh resistor is connected to the first end of the gain circuit and the negative input end of the operational amplifier respectively;
[0040] The positive input terminal of the operational amplifier serves as the input terminal of the signal amplifying circuit;
[0041] The output end of the operational amplifier is connected to the second end of the gain circuit, and the connection point serves as the output end of the signal amplifying circuit.
[0042] Optionally, the gain circuit includes: a tenth resistor, a twelfth resistor and a controllable switch;
[0043] One end of the tenth resistor is connected to one end of the twelfth resistor, and the connection point serves as the first end of the gain circuit;
[0044] The other end of the tenth resistor is connected to one end of the controllable switch, and the connection point serves as the second end of the gain circuit;
[0045] The other end of the twelfth resistor is connected to the other end of the controllable switch.
[0046] Optionally, it also includes: a hysteresis comparison circuit;
[0047] The input end of the hysteresis comparison circuit is respectively connected to the output pin of the current type sensor and the first end of the acquisition conversion circuit;
[0048] The output end of the hysteresis comparison circuit is connected to the output end of the signal conversion circuit.
[0049] Optionally, the hysteresis comparison circuit comprises: a second comparator and a thirteenth resistor;
[0050] The negative input terminal of the second comparator receives a reference voltage;
[0051] The positive input terminal of the second comparator is connected to one end of the thirteenth resistor, and the connection point serves as the input terminal of the hysteresis comparison circuit;
[0052] The output end of the second comparator is connected to the other end of the thirteenth resistor, and the connection point serves as the output end of the hysteresis comparison circuit.
[0053] It can be seen from the above technical scheme that the present invention provides a signal conversion circuit; the first end of the acquisition conversion circuit is respectively connected to the output pin of the current sensor and the output end of the signal conversion circuit; the second end of the acquisition conversion circuit is grounded; the first input end of the first comparison circuit is connected to the output pin of the current sensor; the second input end of the first comparison circuit is connected to the power supply; the first input end of the drive circuit is connected to the output end of the first comparison circuit; the second input end of the drive circuit receives the control signal of the MCU; the input end of the MCU is connected to the output pin of the current sensor through a first resistor; the output end of the drive circuit is connected to the control end of the acquisition conversion circuit; when the output current of the current sensor is higher than the preset current, the output signal of the first comparison circuit indicates the control The acquisition conversion circuit is turned off; and when at least one of the output signal of the first comparison circuit and the control signal of the MCU indicates that the acquisition conversion circuit is controlled to be turned off, the driving circuit controls the acquisition conversion circuit to be turned off; that is, the protection of the acquisition conversion circuit can be through MCU protection or through the first comparison circuit, and the first comparison circuit is a hardware circuit with a fast processing speed, which can quickly control the acquisition conversion circuit to be turned off, thereby avoiding the situation where the MCU code judgment time is too long, or the MCU program cannot jump to execute other codes in time due to a high-level interrupt, or the MCU is in a program runaway state and other untimely control situations, thereby improving the safety of the acquisition conversion circuit 30 and reducing the probability of the acquisition conversion circuit being burned out due to untimely protection. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 is a schematic diagram of a signal conversion circuit provided by an embodiment of the present invention;
[0056] Figure 2 is a schematic diagram of a signal conversion circuit provided by an embodiment of the present invention;
[0057] Figure 3 The present invention provides a control flow chart of a signal conversion circuit. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] In the present application, the term "comprises", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of further restrictions, the elements defined by the sentence "comprising one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. In addition, the terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here, for example.
[0060] Terminology explanation:
[0061] ECU: The electronic control unit (ECU) is a comprehensive control device for the engine. Its function is to calculate, process, and judge various information input by the engine sensors according to its own stored programs, and then output instructions to control the actions of related actuators to achieve the purpose of fast, accurate, and automatic control of the engine operation.
[0062] An embodiment of the present application provides a signal conversion circuit for solving the problem in the prior art that if the code judgment time of the MCU is too long, or the MCU program cannot jump to execute other codes in time when a high-level interrupt occurs, or the MCU is in a program runaway state, the on and off of the MOSFET used for protection is out of control. At this time, if the pin is short-circuited to 32V, the resistor used for current / voltage conversion will quickly burn out due to the 5.12W dissipated power.
[0063] It should be noted that the application scenario of the present invention is that the sensor is far away from the ECU, such as a heavy truck or a large bus. If the sensor and the ECU are arranged at the front and rear of the vehicle, the distance may exceed 10 meters. At this time, if a voltage sensor with a 0-5V output is selected, the voltage signal will produce unexpected line loss at the final ECU receiving end due to the long wiring harness, causing signal distortion. In this scenario, it is advisable to select a current sensor because the transmission of the current signal is not affected by the length of the line, so a current sensor is used for data acquisition.
[0064] like Figure 1 As shown in the figure, it shows the connection relationship between the current sensor and the ECU. The current sensor can use a 4-20mA or 7-14mA current signal. After the current signal enters the ECU, it passes through a current / voltage conversion circuit (such as a 200-ohm resistor) and is converted into a voltage signal. This voltage signal is sent to the MCU for analog-to-digital ADC conversion.
[0065] When the pin of the current sensor is short-circuited to the power supply, that is, the pin voltage is relatively high during the short circuit, such as 28V. At this time, if the current of 28V / 200Ω=140mA flows directly through the current / voltage conversion circuit (usually a 200-ohm resistor), the 200-ohm resistor needs to dissipate 3.92W of power. The resistor packaging and cost required for such power are unacceptable inside the controller. Therefore, the signal conversion circuit of this application is used to realize data transmission between the current sensor and the ECU. The specific structure of the signal conversion circuit is as follows:
[0066] See also Figure 1 The signal conversion circuit includes: a first comparison circuit 10, a driving circuit 20 and a collection conversion circuit 30.
[0067] The first end of the acquisition conversion circuit 30 is connected to the output pin of the current type sensor and the output end of the signal conversion circuit respectively.
[0068] That is to say, the acquisition conversion circuit 30 is connected to the output pin of the current type sensor, and the connection point is connected to the output end of the signal conversion circuit.
[0069] The output end of the signal conversion circuit can be connected to a corresponding pin of the MCU, for example, to a GTM pin in the MCU.
[0070] A second terminal of the acquisition conversion circuit 30 is grounded.
[0071] That is to say, the acquisition conversion circuit 30 is arranged between the output pin of the current type sensor and the ground, and then the acquisition conversion circuit 30 can convert the current signal output by the current type sensor into a voltage signal, thereby realizing the acquisition of the current signal of the current type sensor.
[0072] The first input terminal of the first comparison circuit 10 is connected to the output pin of the current type sensor, that is, the first comparison circuit 10 receives the current signal of the current type sensor.
[0073] A second input terminal of the first comparison circuit 10 is connected to a power supply.
[0074] It should be noted that a PTC resistor can also be provided between the first comparison circuit 10 and the acquisition conversion circuit 30. When the output pin of the current type sensor is short-circuited to the ground, the current flowing through the PTC resistor increases, the PTC heats up, and the resistance value increases, and eventually it will stay in a balanced state. At this time, a 200-ohm resistor is required to withstand the heat dissipated by the current for a long time.
[0075] It should be noted that the first comparison circuit 10 converts the received current signal into a voltage signal, and then compares the converted voltage signal with the power supply voltage signal to output a control signal. Specifically, the first comparison circuit 10 uses hardware judgment; when the current signal output by the current sensor is greater than the preset current, the control signal output by the first comparison circuit 10 instructs the control acquisition conversion circuit 30 to turn off; when the signal output by the current sensor is less than or equal to the preset current, the control signal output by the first comparison circuit 10 instructs the control acquisition conversion circuit 30 to turn on.
[0076] The first input terminal of the driving circuit 20 is connected to the output terminal of the first comparing circuit 10 , and receives the output signal of the first comparing circuit 10 (ie, the control signal output by the first comparing circuit 10 ).
[0077] The second input terminal of the driving circuit 20 receives a control signal from the MCU.
[0078] Specifically, the second input terminal of the driving circuit 20 is connected to the control terminal of the MCU and receives the control signal of the MCU.
[0079] MCU input terminal (such as Figure 1 The MCU_ADC_DIAG shown in the figure is connected to the output pin of the current sensor through the first resistor R1; that is, the MCU can collect the current signal output by the current sensor through the first resistor R1, and perform corresponding processing according to the current signal to obtain a control signal for controlling the on and off of the acquisition conversion circuit 30. For example, the MCU collects the current signal output by the current sensor, performs software judgment, and when the current signal is greater than the first threshold, the MCU outputs a shutdown signal; when the current signal is less than the first threshold, the MCU outputs an on signal.
[0080] The first threshold value may be the same as or different from the above-mentioned preset current, and is not specifically limited here.
[0081] Specifically, when the voltage signal converted from the current signal of the current sensor exceeds a preset threshold, protection measures need to be immediately implemented on the acquisition conversion circuit 30 to terminate the conversion process.
[0082] The output pin of the current sensor is connected to the ADC module of the MCU through the first resistor R1 in series. At this time, the ADC module reads the full-scale reference voltage. The ECU uses this voltage value as a basis for judgment to identify whether the output pin or wiring harness of the current sensor is short-circuited to the power supply. Once the short circuit is confirmed, the ECU will send the necessary diagnostic information to the vehicle controller for display on the dashboard, thereby notifying the driver to take necessary maintenance measures.
[0083] Specifically, Figure 2 As shown, the current signal is converted into a voltage signal by the first resistor R1 and flows into the ADC module of the MCU; the MCU determines whether the pin voltage is overvoltage, that is, whether the voltage signal converted by the first resistor R1 is greater than the threshold value. If so, the MCU controls the acquisition conversion circuit 30 to stop the current / voltage conversion, that is, the acquisition conversion circuit 30 is controlled to be in the shutdown mode; the latter stage of the acquisition conversion circuit 30 can also be provided with a signal amplification circuit 40 to amplify the voltage signal so that the GTM end of the MCU receives the data transmitted by the current type sensor. The resistance value of the first resistor R1 is usually large, such as more than 30K ohms. The first resistor R1 adopts a large resistance value to protect the corresponding pin of the ADC module of the MCU from damage by the 28V high voltage.
[0084] The output end of the driving circuit 20 is connected to the control end of the acquisition conversion circuit 30. The driving circuit 20 drives the acquisition conversion circuit 30 to be turned on and off according to the output signal of the first comparison circuit 10 and the control signal of the MCU.
[0085] When the output current of the current type sensor is higher than the preset current, the output signal of the first comparison circuit 10 indicates that the acquisition conversion circuit 30 is controlled to be shut down; and when at least one of the output signal of the first comparison circuit 10 and the control signal of the MCU indicates that the acquisition conversion circuit 30 is controlled to be shut down, the drive circuit 20 controls the acquisition conversion circuit 30 to be shut down.
[0086] That is to say, when the output current of the current type sensor is higher than the preset current, the output signal of the first comparison circuit 10 indicates that the control acquisition conversion circuit 30 is turned off, and the drive signal controls the acquisition conversion circuit 30 to be in the off state; or, when the control signal of the MCU indicates that the control acquisition conversion circuit 30 is turned off, the drive signal controls the acquisition conversion circuit 30 to be in the off state; or, the control signal of the MCU indicates that the control acquisition conversion circuit 30 is turned off, and when the output current of the current type sensor is higher than the preset current, the output signal of the first comparison circuit 10 indicates that the control acquisition conversion circuit 30 is turned off, and the drive signal controls the acquisition conversion circuit 30 to be in the off state; when the acquisition conversion circuit 30 is in the off state, the acquisition conversion circuit 30 stops working.
[0087] Optionally, when the output signal of the first comparison circuit 10 and the control signal of the MCU both indicate to control the acquisition conversion circuit 30 to be closed, the driving circuit 20 controls the acquisition conversion circuit 30 to be closed.
[0088] That is to say, when the output current of the current type sensor is not higher than the preset current, the output signal of the first comparison circuit 10 instructs the control acquisition conversion circuit 30 to be closed; and when the output current of the current type sensor is not higher than the first threshold, the control signal of the MCU instructs the control acquisition conversion circuit 30 to be closed; when these two conditions are met, the acquisition conversion circuit 30 will be in a closed state, that is, the acquisition conversion circuit 30 performs the acquisition action.
[0089] In this embodiment, the first end of the acquisition conversion circuit 30 is respectively connected to the output pin of the current sensor and the output end of the signal conversion circuit; the second end of the acquisition conversion circuit 30 is grounded; the first input end of the first comparison circuit 10 is connected to the output pin of the current sensor; the second input end of the first comparison circuit 10 is connected to the power supply; the first input end of the drive circuit 20 is connected to the output end of the first comparison circuit 10; the second input end of the drive circuit 20 receives the control signal of the MCU; the input end of the MCU is connected to the output pin of the current sensor through the first resistor R1; the output end of the drive circuit 20 is connected to the control end of the acquisition conversion circuit 30; when the output current of the current sensor is higher than the preset current, the output signal of the first comparison circuit 10 indicates the control of the acquisition conversion circuit 30 Shut down; and, when at least one of the output signal of the first comparison circuit 10 and the control signal of the MCU indicates to control the acquisition conversion circuit 30 to shut down, the driving circuit 20 controls the acquisition conversion circuit 30 to shut down; that is, the protection of the acquisition conversion circuit 30 can be through the MCU protection, and can also be protected by the first comparison circuit 10, and the first comparison circuit 10 is a hardware circuit with a fast processing speed, which can quickly control the acquisition conversion circuit 30 to shut down, avoiding the situation that the MCU code judgment time is too long, or the MCU program cannot jump to execute other codes in time due to a high-level interrupt, or the MCU is in a program runaway state and other untimely control situations, thereby improving the safety of the acquisition conversion circuit 30 and reducing the probability of the acquisition conversion circuit 30 burning due to untimely protection.
[0090] Optionally, the first comparison circuit 10 includes: a second resistor R2, a third resistor R3, a fourth resistor R4, a fifth resistor R5 and a first comparator U1.
[0091] One end of the second resistor R2 serves as a first input end of the first comparison circuit 10 and is connected to an output pin of the current sensor to receive a current signal from the sensor.
[0092] The other end of the second resistor R2 is connected to one end of the third resistor R3 and the negative input end of the first comparator U1 respectively.
[0093] One end of the fourth resistor R4 is used as the second input end of the first comparison circuit 10 and is connected to a power supply; the power supply may be a 5V power supply, or other power supplies, which will not be described in detail here.
[0094] The other end of the fifth resistor R5 is connected to one end of the fifth resistor R5 and the positive input end of the first comparator U1 respectively.
[0095] The other end of the fifth resistor R5 and the other end of the third resistor R3 are both grounded.
[0096] The output terminal of the first comparator U1 serves as the output terminal of the first comparison circuit 10 .
[0097] That is to say, the fourth resistor R4 and the fifth resistor R5 form a voltage divider circuit so that the positive input terminal of the first comparator U1 can receive a threshold voltage. At the same time, the second resistor R2 and the third resistor R3 also form a voltage divider circuit to convert the current signal of the current sensor into a voltage signal and transmit it to the negative input terminal of the first comparator U1; that is, the first comparator U1 compares the voltage signal corresponding to the current signal of the current sensor with the threshold voltage, and through the output of the first comparator U1, it can be known whether the output current of the current sensor exceeds the preset current.
[0098] Optionally, the driving circuit 20 includes: an AND gate and an eighth resistor R8.
[0099] The first input terminal of the AND gate serves as the first input terminal of the driving circuit 20 .
[0100] The second input terminal of the AND gate serves as the second input terminal of the driving circuit 20 .
[0101] The output end of the AND gate is connected to one end of the eighth resistor R8 , and the connection point serves as the output end of the driving circuit 20 .
[0102] The other end of the eighth resistor R8 is grounded.
[0103] That is to say, the AND gate element has two input terminals and one output terminal. Among them, the first input terminal of the AND gate directly serves as the first input port of the entire driving circuit 20, which is used to receive the output signal of the first comparison circuit 10. Similarly, the second input terminal of the AND gate serves as the second input port of the driving circuit 20, which is responsible for receiving the control signal of the MCU.
[0104] When these two signals enter the AND gate through their respective input ports at the same time, after the logic operation inside the AND gate (that is, the output is high only when both input signals are high), the operation result will be output from the output end of the AND gate. That is, after the first comparator U1 circuit makes a preliminary judgment, it performs an "AND" operation with the control signal of the MCU, and then controls the on and off of the switch tube M1 in the acquisition circuit. This solution can be compatible with a very useful function, that is, it can be multiplexed as a normal analog signal input.
[0105] The output end of the AND gate is connected to one end of the eighth resistor R8, and the connection point is defined as the output end of the driving circuit 20 and connected to the control end of the acquisition conversion circuit 30. Through the output end of the driving circuit 20, a signal after the AND gate logic operation can be output to control the on and off of the acquisition conversion circuit 30.
[0106] The logic of the AND gate is shown in Table 1:
[0107] Table 1: Relationship between true value and acquisition conversion circuit 30
[0108] First input signal Second input signal Output signal The state of the acquisition conversion circuit 30 1 1 1 Closed state 1 0 0 Shutdown state 0 1 0 Shutdown state 0 0 0 Shutdown state
[0109] The first input signal is the output signal of the first comparison circuit 10 ; the second input signal is the control signal of the MCU.
[0110] Optionally, the acquisition conversion circuit 30 includes: a switch tube M1, a sixth resistor R6, a seventh resistor R7 and a ninth resistor R9.
[0111] One end of the switch tube M1 is connected to one end of the sixth resistor R6 and one end of the ninth resistor R9 respectively.
[0112] The other end of the switch tube M1 is connected to one end of the seventh resistor R7 and the other end of the ninth resistor R9 respectively.
[0113] The control end of the switch tube M1 serves as the control end of the acquisition conversion circuit 30 .
[0114] The other end of the sixth resistor R6 serves as the first end of the acquisition conversion circuit 30 .
[0115] The other end of the seventh resistor R7 serves as the second end of the acquisition conversion circuit 30 .
[0116] In the acquisition conversion circuit 30, the switch tube M1 plays a key role in conduction and cutoff. One end of the switch tube M1 is closely connected to one end of the sixth resistor R6 and one end of the ninth resistor R9, forming a signal intersection. The other end of the switch tube M1 is connected to one end of the seventh resistor R7 and the other end of the ninth resistor R9, respectively, forming another signal transmission path.
[0117] In particular, the control end of the switch tube M1 is designed as the control port of the acquisition conversion circuit 30, which means that by sending a control signal to this port, the on or off state of the switch tube M1 can be accurately controlled, thereby further affecting the signal transmission of the entire acquisition conversion circuit 30.
[0118] In addition, the other end of the sixth resistor R6 is designated as the first end of the acquisition conversion circuit 30, which is used for the current signal output by the current type sensor. The other end of the seventh resistor R7 is grounded. Furthermore, the sixth resistor R6 and the seventh resistor R7 can convert the current signal into a voltage signal when the switch tube M1 is turned on; and when the switch tube M1 is turned off, the sixth resistor R6, the ninth resistor R9 and the seventh resistor R7 are connected in series; and the resistance value of the ninth resistor R9 is very large, realizing the function of protecting the sixth resistor R6 and the seventh resistor R7.
[0119] In addition, the ninth resistor R9 exists to achieve a compatible design of the circuit so that it can support the output of non-current sensors (such as voltage sensors). When the MCU actively turns off the switch tube M1 through MCU_IO_1, Figure 3 The circuit can be transformed into an input processing circuit of a voltage type sensor. At this time, the voltage value output by the voltage type sensor will be sent to the pin of the ADC module corresponding to ADC_DIAG of the MCU through the first resistor R1, realizing direct collection of the voltage value.
[0120] It should be noted that after the current signal of the current sensor enters the ECU, it will flow through a series of large package resistors in a series-parallel combination (the total resistance after the combination is 200 ohms). This step converts the current signal into a voltage signal and directly transmits it to the MCU for analog-to-digital (AD) conversion. If the pin of the current sensor is accidentally short-circuited with the battery power supply, the ECU pin will continue to receive a higher voltage, such as 32V. In this case, the resistors in the series-parallel combination jointly bear the dissipated power generated by the 32V power supply, and P=32×32 / 200=5.12W is calculated. If the series-parallel method is not used, a single 200-ohm resistor will have to bear the entire 5.12W dissipated power, which will result in a larger resistor size and reduced accuracy, and is not suitable for use inside the ECU. Therefore, 8 to 12 resistors are usually used in series and parallel to share the power. However, this solution is costly, and its advantages are not obvious when the sensor is working normally and the pins are not short-circuited.
[0121] In contrast, in this embodiment, only two 100 ohm resistors (the sixth resistor R6 and the seventh resistor R7) are used to complete signal acquisition and conversion, and a low-cost 22K ohm resistor (the ninth resistor R9) is introduced as a protection resistor. This design not only reduces the cost, but also effectively protects the sixth resistor R6 and the seventh resistor R7.
[0122] Specifically, Figure 3 As shown in the figure, the current sensor is configured with two key pins. The upper pin is responsible for providing power to the sensor. Usually, in order to ensure that the ECU receiving end has sufficient voltage margin, the power supply voltage of this current sensor is set above 12V. The lower pin is the output pin of the current sensor, which is used to transmit 4-20mA or 7-14mA current signals. After these current signals flow through the sixth resistor R6 and the seventh resistor R7, they will be converted into 0.8V-4V or 1.4V-2.8V voltage signals.
[0123] Next, the voltage signal is processed by a variable gain signal amplifier circuit 40 and compared with the reference voltage V_REF of the second comparator U3. The second comparator U3 outputs a voltage square wave signal in PWM mode, which is eventually sent to the GTM function pin of the MCU, and the MCU identifies and analyzes the frequency and duty cycle.
[0124] When the output pin of the current sensor is short-circuited to the power supply and the voltage exceeds a preset threshold value Vth; that is, when the output current of the current sensor exceeds the preset current, the first comparator U1U1 will respond quickly and output a low level. After passing through the AND gate, this low level signal will maintain a low level state, thereby ensuring that the control switch tube M1 is reliably turned off to protect the sixth resistor R6 and the seventh resistor R7 from damage.
[0125] If the sensor is in an open circuit or idle state, the ninth resistor R9 will combine with the sixth resistor R6 and the seventh resistor R7 to provide a 0V voltage value pulled down to the ground, thereby helping the MCU to determine whether the output pin of the sensor is in an open circuit or idle state through the current resistor. Because in actual applications, when the sensor is connected normally, no matter what state the physical quantity it faces is in, its effective output voltage will remain in a specific range (such as 0.5-4.5V). If it exceeds this range, it can be determined that the pin is in an open circuit state or short-circuited to the power state.
[0126] In addition, the MCU can control the output of the AND gate to a low level through the MCU_IO_1 signal. At this time, the output pins of the current sensor can also be used as a common analog voltage input signal acquisition channel.
[0127] Optionally, it also includes: a signal amplifying circuit 40.
[0128] The input end of the signal amplifying circuit 40 is connected to the output pin of the current type sensor and the first end of the acquisition conversion circuit 30 respectively; the output end of the signal amplifying circuit 40 is connected to the output end of the signal conversion circuit.
[0129] The input end of the signal amplifying circuit 40 receives the collected signal of the collecting and converting circuit 30 , and sends the collected signal of the collecting and converting circuit 30 as an input signal to the signal amplifying circuit 40 for amplification processing.
[0130] The design of the signal amplifying circuit 40 can be applied to various types of sensors, thereby improving the applicability of the signal conversion circuit.
[0131] Optionally, the signal amplifying circuit 40 includes: an operational amplifier U2, a gain circuit and an eleventh resistor R11.
[0132] One end of the eleventh resistor R11 is grounded.
[0133] The other end of the eleventh resistor R11 is connected to the first end of the gain circuit and the negative input end of the operational amplifier U2 respectively.
[0134] The positive input terminal of the operational amplifier U2 serves as the input terminal of the signal amplifying circuit 40 .
[0135] The output end of the operational amplifier U2 is connected to the second end of the gain circuit, and the connection point serves as the output end of the signal amplifying circuit 40 .
[0136] Among them, the eleventh resistor R11 plays a key grounding role. One end of the eleventh resistor R11 is connected to the common ground (i.e., the grounding end) of the circuit. The other end of the eleventh resistor R11 is electrically connected to the first end of the gain circuit and the negative input end (i.e., the inverting input end) of the operational amplifier U2. Such a connection method helps to stabilize the working state of the circuit and provides the necessary reference potential for signal amplification.
[0137] The operational amplifier U2 is a core component for signal amplification, and its positive input terminal (i.e., the in-phase input terminal) is designed as the input terminal of the signal amplification circuit 40. This means that the signal from the outside (such as the output signal of the acquisition conversion circuit 30) will enter the operational amplifier U2 through this port for subsequent amplification processing.
[0138] The output end of the operational amplifier U2 is connected to the second end of the gain circuit. This connection point not only serves as the output end of the signal amplification, transmitting the amplified signal to the subsequent circuit, but is also a part of the gain circuit. By adjusting the parameters of the gain circuit, the amplitude of the amplified signal can be accurately controlled.
[0139] In summary, the signal amplification circuit 40 achieves stable amplification and precise control of the input signal through the coordinated work of the operational amplifier U2, the gain circuit and the eleventh resistor R11, providing a reliable basis for subsequent signal processing.
[0140] Optionally, the gain circuit includes: a tenth resistor R10, a twelfth resistor R12 and a controllable switch.
[0141] One end of the tenth resistor R10 is connected to one end of the twelfth resistor R12, and the connection point serves as a first end of the gain circuit.
[0142] The other end of the tenth resistor R10 is connected to one end of the controllable switch, and the connection point serves as the second end of the gain circuit.
[0143] The other end of the twelfth resistor R12 is connected to the other end of the controllable switch.
[0144] The control end of the controllable switch is connected to the second output end of the MCU.
[0145] The tenth resistor R10 is connected to one end of the twelfth resistor R12, and this connection point is set as the first end of the gain circuit, that is, the signal input end. This means that the signal to be amplified will first enter this connection point to provide input for the subsequent amplification process.
[0146] Next, the other end of the tenth resistor R10 is connected to one end of the controllable switch, and this connection point serves as the second end of the gain circuit, that is, the key node between the signal output end and the amplification control. By adjusting the state of the controllable switch, the degree of signal amplification can be precisely controlled.
[0147] The other end of the twelfth resistor R12 is electrically connected to the other end of the controllable switch. Such a design not only ensures the integrity of the circuit, but also enables the gain circuit to flexibly adjust the signal amplification factor according to the on-off state of the controllable switch, thereby meeting different signal processing requirements.
[0148] Another control signal MCU_IO_2 of the MCU controls the on and off of a controllable switch to select different voltage amplification factors to further improve the signal quality.
[0149] In summary, the gain circuit realizes flexible regulation of the signal amplification factor through the tenth resistor R10, the twelfth resistor R12 and the controllable switch, providing a more accurate and flexible control means for signal processing.
[0150] Optionally, it also includes: a hysteresis comparison circuit 50.
[0151] The input end of the hysteresis comparison circuit 50 is connected to the output pin of the current source sensor and the first end of the acquisition conversion circuit 30 respectively.
[0152] The output terminal of the hysteresis comparison circuit 50 is connected to the output terminal of the signal conversion circuit.
[0153] The hysteresis comparison circuit 50 is used to directly convert the acquisition signal of the acquisition conversion circuit 30 into a PWM square wave, or to convert the amplified acquisition signal into a PWM square wave.
[0154] That is, when the signal conversion circuit includes the signal amplifying circuit 40, the output end of the hysteresis comparison circuit 50 is arranged between the signal amplifying circuit 40 and the output end of the signal conversion circuit. When the signal conversion circuit does not include the signal amplifying circuit 40, the hysteresis comparison circuit 50 is arranged between the output end of the acquisition conversion circuit 30 and the output end of the signal conversion circuit.
[0155] Optionally, the hysteresis comparison circuit 50 includes: a second comparator U3 and a thirteenth resistor.
[0156] A negative input terminal of the second comparator U3 receives a reference voltage V_REF.
[0157] The positive input terminal of the second comparator U3 is connected to one end of the thirteenth resistor, and the connection point is used as the input terminal of the hysteresis comparison circuit 50 and is connected to the first end of the acquisition conversion circuit 30 .
[0158] The output end of the second comparator U3 is connected to the other end of the thirteenth resistor, and the connection point serves as the output end of the hysteresis comparison circuit 50 and is connected to the output end of the signal conversion circuit.
[0159] The second comparator U3 is the core of the circuit, responsible for comparing the input signal with the reference voltage and outputting the corresponding comparison result. The thirteenth resistor is connected to the positive input terminal and the output terminal of the second comparator U3 to provide a certain feedback effect for the circuit, thereby realizing the hysteresis characteristic.
[0160] The input end of the hysteresis comparison circuit 50 is connected to the output pin of the current sensor and the first end of the acquisition conversion circuit 30. In this way, the current signal from the current sensor is converted into a voltage signal after being processed by the acquisition conversion circuit 30, and the voltage signal is used as an input signal to enter the hysteresis comparison circuit 50.
[0161] The negative input terminal of the second comparator U3 receives a preset reference voltage, which is the basis for the circuit to compare and determines when the input signal triggers the change of the output signal.
[0162] When the input signal enters the positive input terminal of the second comparator U3 through the thirteenth resistor, the second comparator U3 compares it with the reference voltage at the negative input terminal. If the input signal is greater than the reference voltage, the second comparator U3 outputs a high level signal; if the input signal is less than the reference voltage, the second comparator U3 outputs a low level signal.
[0163] Due to the existence of the thirteenth resistor, when the input signal changes near the reference voltage, the output of the second comparator U3 does not immediately change with the change of the input signal, but will remain in a stable state for a period of time, which is the manifestation of the hysteresis characteristic. In other words, the second comparator U3U3 sets a positive feedback mechanism through the thirteenth resistor to achieve the hysteresis characteristic. This characteristic can effectively avoid the unexpected square wave signal output caused by the noise in the front-end signal, thereby improving the robustness of the system.
[0164] Specifically, when the input signal rises from a low level to a high level, it needs to exceed a higher upper threshold to trigger the second comparator U3 to output a high level; and when the input signal drops from a high level to a low level, it needs to be lower than a lower lower threshold to trigger the second comparator U3 to output a low level. The difference between these two thresholds constitutes the hysteresis width.
[0165] The output end of the second comparator U3 is connected to the output end of the signal conversion circuit. In this way, the output signal after hysteresis comparison can be transmitted to the subsequent signal conversion circuit for the next step of processing or transmission.
[0166] In summary, the hysteresis comparison circuit 50 compares the input signal with the reference voltage and uses the feedback resistor to realize the hysteresis characteristic, thereby being able to stably output the comparison result and effectively suppress the noise and jitter in the input signal. This makes the hysteresis comparison circuit 50 have a wide range of application value in the fields of signal processing, waveform shaping, noise suppression, etc.
[0167] When the wiring harness of the current sensor is not short-circuited with the power supply, the current signal of the current sensor is processed by the acquisition conversion circuit 30 and appropriately amplified according to the strength of the original current signal to ensure that it is converted into a voltage signal with sufficient amplitude. This voltage signal is then converted into a square wave signal in PWM mode by a comparator and then sent to the GTM module of the MCU for reception and processing.
[0168] From the above description, it can be seen that in addition to outputting the current signal as a PWM square wave, the current signal can also be converted into a voltage signal through a collection and conversion circuit. This voltage signal will flow through the first resistor R1 in series and then be sent to the ADC module of the MCU for collection. In practical applications, current sensors can be used to collect actual physical signals such as oil pressure and water temperature, and then the signals collected by the current sensor can represent actual physical signals such as oil pressure and water temperature, providing an important basis for system monitoring and control.
[0169] The features recorded in the various embodiments in this specification can be replaced or combined with each other, and the same and similar parts between the various embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0170] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0171] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one 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 present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A signal conversion circuit, characterized in that: include: A first comparison circuit, a driving circuit and an acquisition conversion circuit; The first end of the acquisition conversion circuit is connected to the output pin of the current type sensor and the output end of the signal conversion circuit respectively; The second end of the acquisition conversion circuit is grounded; The first input terminal of the first comparison circuit is connected to the output pin of the current type sensor; The second input terminal of the first comparison circuit is connected to a power supply; The first input terminal of the driving circuit is connected to the output terminal of the first comparison circuit; The second input terminal of the driving circuit receives the control signal of the MCU; the input terminal of the MCU is connected to the output pin of the current type sensor through a first resistor; The output end of the driving circuit is connected to the control end of the acquisition conversion circuit; When the output current of the current type sensor is higher than a preset current, the output signal of the first comparison circuit indicates that the acquisition conversion circuit is controlled to be shut down; and when at least one of the output signal of the first comparison circuit and the control signal of the MCU indicates that the acquisition conversion circuit is controlled to be shut down, the drive circuit controls the acquisition conversion circuit to be shut down.
2. The signal conversion circuit according to claim 1, characterized in that: When the output signal of the first comparison circuit and the control signal of the MCU both indicate to control the acquisition conversion circuit to be closed, the driving circuit controls the acquisition conversion circuit to be closed.
3. The signal conversion circuit according to claim 1, characterized in that: The first comparison circuit includes: a second resistor, a third resistor, a fourth resistor, a fifth resistor and a first comparator; One end of the second resistor serves as a first input end of the first comparison circuit; The other end of the second resistor is connected to one end of the third resistor and the negative input end of the first comparator respectively; One end of the fourth resistor serves as a second input end of the first comparison circuit; The other end of the fifth resistor is connected to one end of the fifth resistor and the positive input end of the first comparator respectively; The other end of the fifth resistor and the other end of the third resistor are both grounded; The output end of the first comparator serves as the output end of the first comparison circuit.
4. The signal conversion circuit according to claim 1, characterized in that: The driving circuit comprises: an AND gate and an eighth resistor; The first input terminal of the AND gate serves as the first input terminal of the driving circuit; The second input terminal of the AND gate serves as the second input terminal of the driving circuit; The output end of the AND gate is connected to one end of the eighth resistor, and the connection point serves as the output end of the driving circuit; The other end of the eighth resistor is grounded.
5. The signal conversion circuit according to claim 1, characterized in that: The acquisition conversion circuit includes: a switch tube, a sixth resistor, a seventh resistor and a ninth resistor; One end of the switch tube is connected to one end of the sixth resistor and one end of the ninth resistor respectively; The other end of the switch tube is respectively connected to one end of the seventh resistor and the other end of the ninth resistor; The control end of the switch tube serves as the control end of the acquisition conversion circuit; The other end of the sixth resistor serves as the first end of the acquisition conversion circuit; The other end of the seventh resistor serves as the second end of the acquisition conversion circuit.
6. The signal conversion circuit according to claim 1, characterized in that: Also includes: Signal amplification circuit; The input end of the signal amplifying circuit is respectively connected to the output pin of the current type sensor and the first end of the acquisition conversion circuit; The output end of the signal amplifying circuit is connected to the output end of the signal converting circuit.
7. The signal conversion circuit according to claim 6, characterized in that: The signal amplifying circuit comprises: an operational amplifier, a gain circuit and an eleventh resistor; One end of the eleventh resistor is grounded; The other end of the eleventh resistor is connected to the first end of the gain circuit and the negative input end of the operational amplifier respectively; The positive input terminal of the operational amplifier serves as the input terminal of the signal amplifying circuit; The output end of the operational amplifier is connected to the second end of the gain circuit, and the connection point serves as the output end of the signal amplifying circuit.
8. The signal conversion circuit according to claim 7, characterized in that: The gain circuit comprises: a tenth resistor, a twelfth resistor and a controllable switch; One end of the tenth resistor is connected to one end of the twelfth resistor, and the connection point serves as the first end of the gain circuit; The other end of the tenth resistor is connected to one end of the controllable switch, and the connection point serves as the second end of the gain circuit; The other end of the twelfth resistor is connected to the other end of the controllable switch.
9. The signal conversion circuit according to claim 1, characterized in that: Also includes: Hysteresis comparator circuit; The input end of the hysteresis comparison circuit is respectively connected to the output pin of the current type sensor and the first end of the acquisition conversion circuit; The output end of the hysteresis comparison circuit is connected to the output end of the signal conversion circuit.
10. The signal conversion circuit according to claim 9, characterized in that: The hysteresis comparison circuit comprises: a second comparator and a thirteenth resistor; The negative input terminal of the second comparator receives a reference voltage; The positive input terminal of the second comparator is connected to one end of the thirteenth resistor, and the connection point serves as the input terminal of the hysteresis comparison circuit; The output end of the second comparator is connected to the other end of the thirteenth resistor, and the connection point serves as the output end of the hysteresis comparison circuit.