Analog switch expansion multipath ADC sampling circuit for new energy automobile
By designing analog switches to expand multi-channel ADC sampling circuit, using analog switch chip CD4052 to simultaneously acquire multiple voltage signals in new energy vehicles, solving the problem of insufficient MCU ADC channels, realizing low-cost ADC channel expansion and communication expansion, improving the improvement of the cost Sampling efficiency.
Patent Information
- Application Number
- CN202411489829.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2024-12-10
AI Technical Summary
In new energy vehicles, insufficient ADC channels of MCUs lead to high cost external ADC sampling chips being used to expand sampling capabilities, and the prior art cannot effectively solve the cost sensitivity problem.
Design an analog switch extension multi-channel ADC sampling circuit, including a differential amplification sampling circuit, a sampling filter circuit, an analog switch multi-select circuit and a MCU minimum system sampling circuit, and use the analog switch chip CD4052 to simultaneously acquire multiple voltage signals in one cycle. , avoid using external ADC sampling chips.
It realizes expanding more ADC channels without increasing costs, alleviating the problem of insufficient MCU ADC channels, and supports more signal sampling or communication expansion when the analog switch output frequency is higher than the sampling frequency.
Smart Images

Figure CN119109457A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of new energy vehicles, and in particular to an analog switch expansion multi-channel ADC sampling circuit for new energy vehicles. Background Art
[0002] In new energy vehicles, the high-voltage control board dominates the sampling of all-in-one contactors and voltages. Normally, an MCU's ADC has 8 channels. A slightly larger MCU, such as STM32F1, has two or three ADCs and only 24 ADC sampling channels. However, sometimes the MCU pins are not enough and only about 10 ADC channels can be used. This requires the use of a 4-to-1 analog switch to expand multi-channel ADC sampling.
[0003] Currently, most of the ADC sampling chips on the market will use professional ADC sampling chips, such as ADS1256IDBR, when the ADC channels of the MCU are insufficient. This professional ADC sampling chip uses SPI bus communication, which can improve the accuracy and expand the ADC when the ADC channels of the MCU are insufficient and the ADC accuracy of the MCU is insufficient. However, the disadvantage is that the cost is very high. Usually, the cost of a better ADC sampling chip is no less than that of an MCU, which is unacceptable for cost-sensitive industries. Summary of the invention
[0004] The object of the present invention is to provide an analog switch expansion multi-channel ADC sampling circuit for new energy vehicles.
[0005] To achieve the above object, the present invention provides the following technical solution: an analog switch expansion multi-channel ADC sampling circuit for new energy vehicles, comprising: A differential amplifier sampling circuit is used to collect voltage signals, amplify them and then output voltage; A sampling filter circuit, used for filtering the amplified voltage; and The analog switch multiple-select-one circuit is used to obtain the filtered voltage and then select the output and perform ADC sampling.
[0006] Furthermore, the differential amplification sampling circuit includes resistors R1, R2, R3, R4, R5, R6, a diode D1, capacitors C1, C2, and an amplifying comparator U1. One end of the resistor R4 is connected in series with R2, R1, and R3 in sequence, the other end of the resistor R4 is connected to the positive input end of the amplifying comparator U1, the other end of the resistor R3 is connected to the negative input end of the amplifying comparator U1, the negative electrode of the diode D1 is connected between the resistor R4 and U1, the positive electrode of the diode D1 is connected between the resistor R3 and U1, the capacitor C1 is connected in series with the resistor R5 and then connected between the negative electrode of the diode D1 and U1, one end of the capacitor C2 is connected in parallel with the resistor R6 and connected between the positive electrode of the diode D1 and U1, and the other end is connected to the output end of the amplifying comparator U1.
[0007] Furthermore, the sampling filter circuit includes resistors R49, R50, and a capacitor C17. The resistors R49 and R50 are connected in series, and one end of the capacitor C17 is connected between R49 and R50.
[0008] Furthermore, it also includes a clamping circuit U3 for preventing negative voltage and high voltage from being applied to the MCU sampling pin, and the clamping circuit U3 is connected between R49 and R50.
[0009] Furthermore, the analog switch multiple-select-one circuit includes an analog switch chip U11, resistors R66, R67, and the resistors R66, R67 are connected in parallel to the analog switch chip U1.
[0010] Furthermore, the model of the analog switch chip U11 is CD4052.
[0011] Furthermore, it also includes an MCU minimum system sampling circuit for providing a voltage signal to the analog switch multiple-selection circuit, the MCU minimum system sampling circuit includes a single-chip microcomputer U12, capacitors C26, C27, C28, C29, C30, C31, C32, and a crystal oscillator X1, the capacitors C26 and C27 are connected in parallel and connected to the single-chip microcomputer U12, the crystal oscillator X1 is connected between C26 and C27, and the capacitors C28, C29, C30, C31, and C32 are connected in parallel in sequence and connected to the single-chip microcomputer U12.
[0012] Furthermore, the model of the single chip microcomputer U12 is STM32G474RET6.
[0013] It can be seen from the above technical solution that the present invention has the following beneficial effects: The analog switch expansion multi-channel ADC sampling circuit for new energy vehicles uses analog switches to simultaneously collect multiple voltage signals in one cycle. This can expand more ADC channels at a lower cost without using an external ADC sampling chip, which can greatly alleviate the problem of insufficient ADC channels of the MCU. As long as the output frequency of the analog switch is greater than the sampling chip frequency, more signals can be sampled or used for other communications. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is the overall circuit diagram of the present invention; Figure 2 This is a differential amplification sampling circuit diagram of the present invention; Figure 3 This is a sampling filtering and clamping circuit diagram of the present invention; Figure 4 A circuit diagram for selecting multiple analog switches of the present invention; Figure 5 This is the minimum system sampling circuit of the MCU of the present invention. DETAILED DESCRIPTION
[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0016] See also Figure 1-5 The present invention provides an analog switch extended multi-channel ADC sampling circuit for new energy vehicles, including a differential amplifier sampling circuit, a sampling filter circuit, an analog switch multiple-select-one circuit, a clamping circuit U3 and an MCU minimum system sampling circuit, wherein the differential amplifier sampling circuit includes resistors R1, R2, R3, R4, R5, R6, a diode D1, capacitors C1, C2, and an amplifier comparator U1. One end of the resistor R4 is connected in series with R2, R1, and R3 in sequence, and the other end of the resistor R4 is connected to the positive input end of the amplifier comparator U1. The other end of the resistor R3 is connected to the negative input end of the amplifier comparator U1. The negative electrode of the diode D1 is connected between the resistor R4 and U1, and the positive electrode of the diode D1 is connected between the resistor R3 and U1. The capacitor C1 is connected in series with the resistor R5 and then connected between the negative electrode of the diode D1 and U1. One end of the capacitor C2 is connected in parallel with the resistor R6 and connected between the positive electrode of the diode D1 and U1, and the other end is connected to the output end of the amplifier comparator U1.
[0017] The voltage signal is collected through the differential amplifier sampling circuit, and then amplified and output voltage is obtained. The differential amplifier circuit has the characteristics of temperature compensation. Even if the temperature of the surrounding environment changes, it can still output stably. Because of the virtual short and virtual break, R3=R4, R6=R5; so Vout=(R6 / R3)*(V1_P-V1_N), D1 is a diode used for clamping to prevent the op amp from being burned out by excessive voltage. The capacitor C2 is a phase compensation capacitor to prevent the circuit from self-oscillating and has the function of suppressing high-frequency noise. This method will change the phase of the AC. If the AC signal is sampled, the phase of the AC signal may change due to this capacitor.
[0018] The sampling and filtering circuit includes resistors R49, R50, and capacitor C17. The resistors R49 and R50 are connected in series, and one end of the capacitor C17 is connected between R49 and R50 to filter the amplified voltage; the clamping circuit U3 is connected between R49 and R50, and the voltage output by the differential amplifier sampling circuit passes through a low-pass filter composed of R49 and C17 and is given to the subsequent MCU for sampling and reading, while U3 is a clamping circuit to prevent negative voltage and too high voltage from being applied to the MCU sampling pin to cause damage to the MCU.
[0019] The analog switch multi-select circuit includes an analog switch chip U11, resistors R66 and R67. The resistors R66 and R67 are connected in parallel to the analog switch chip U1, and are used to obtain the filtered voltage and then select the output and perform ADC sampling. The model of the analog switch chip U11 is CD4052. The chip can perform a four-select-one operation, that is, it can select one of the four input voltage signals and output it to the MCU chip for sampling. Its frequency can reach 25MHz, that is, its response ability can support the sampling cycle of the MCU chip.
[0020] Analog switch multiple selection circuit such as Figure 4As shown, the voltage output by the differential amplifier sampling circuit is input into the channel of the analog switch chip U11 after passing through the filter circuit, and then the analog switch chip U11 selects one of four outputs through the A and B selection pins. Because the sampling period of an ADC is 1 / ADC clock frequency, the total time for one sampling is sampling time + 12.5 sampling periods = 239.5 sampling periods + 12.5 sampling periods = 252 sampling periods. If the clock frequency of the MCU is 12MHz, it can be known that an ADC sampling period is 1 / 12MHz=0.0833us, so the time required for one sampling is 21us, and an ADC needs to sample four channels at the same time, which requires 21*4=84us, and a polling cycle is at the millisecond level, so for this sampling, there is enough time to collect four voltage signals in one polling cycle. At the same time, the selection pin of the analog switch chip must also make four actions of 00, 01, 10, and 11 at every interval of 21us, and the timing must be strictly matched with the ADC sampling cycle of the chip. Otherwise, the voltage signal of the upper channel will not be fully collected and the switch of the lower channel will be turned on, resulting in confusion in the data collected by the ADC.
[0021] The MCU minimum system sampling circuit includes a single-chip microcomputer U12, capacitors C26, C27, C28, C29, C30, C31, C32, and a crystal oscillator X1. The capacitors C26 and C27 are connected in parallel and connected to the single-chip microcomputer U12. C26 and C27 are crystal oscillator load capacitors. The crystal oscillator X1 is connected between C26 and C27. X1 is an 8MHz crystal oscillator, which is used for the external crystal oscillator of U12. The capacitors C28, C29, C30, C31, and C32 are connected in parallel in sequence and connected to the single-chip microcomputer U12. The capacitors C28, C29, C30, C31, and C32 are peripheral filter capacitors of the MCU, also known as bypass capacitors. The model of the single-chip microcomputer U12 is STM32G474RET6.
[0022] Only two ADC channels, PA0 and PA1, are used in the MCU minimum system sampling circuit, while PC14 and PC15 are the selection IOs of the analog switch to cooperate with the ADC to collect the voltage signal of one of the four channels. In the circuit, an 8MHz crystal oscillator is used as the main clock of the MCU. After the frequency multiplier inside the chip, the frequency can be changed to the main frequency of 84MHz. After frequency division, the ADC clock can be divided into a frequency of 12MHz. The main power input for ADC sampling comes from the VREF+ and VREF- of the chip. The more accurate the voltage of these two pins, the more accurate the signal sampled by the MCU (excluding the accuracy of the MCU itself).
[0023] Compared with the case of using an external ADC sampling chip, the analog switch for expanding the multi-channel ADC sampling circuit for new energy vehicles can use a lower cost to complete the expansion of more ADC channels.
[0024] In addition to being used to expand ADC channels, the present invention can also be used to expand some communication channels, for example, there are two communication buses in the same circuit.
[0025] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An analog switch expansion multi-channel ADC sampling circuit for new energy vehicles, characterized in that: include: The differential amplifier sampling circuit is used to collect voltage, amplify it and then output a voltage signal; A sampling filter circuit is used to filter the amplified voltage signal; as well as The analog switch multiple-select circuit is used to obtain the filtered voltage signal for multiple selection and output it to the MCU for ADC sampling.
2. The analog switch expansion multi-channel ADC sampling circuit for new energy vehicles according to claim 1, characterized in that: The differential amplification sampling circuit includes resistors R1, R2, R3, R4, R5, R6, a diode D1, capacitors C1, C2, and an amplifying comparator U1. One end of the resistor R4 is connected in series with R2, R1, and R3 in sequence, the other end of the resistor R4 is connected to the positive input end of the amplifying comparator U1, the other end of the resistor R3 is connected to the negative input end of the amplifying comparator U1, the negative electrode of the diode D1 is connected between the resistor R4 and U1, the positive electrode of the diode D1 is connected between the resistor R3 and U1, the capacitor C1 is connected in series with the resistor R5 and then connected between the negative electrode of the diode D1 and U1, one end of the capacitor C2 is connected in parallel with the resistor R6 and then connected between the positive electrode of the diode D1 and U1, and the other end is connected to the output end of the amplifying comparator U1.
3. The analog switch expansion multi-channel ADC sampling circuit for new energy vehicles according to claim 1, characterized in that: The sampling filter circuit includes resistors R49, R50 and a capacitor C17. The resistors R49 and R50 are connected in series, and one end of the capacitor C17 is connected between R49 and R50.
4. The analog switch expansion multi-channel ADC sampling circuit for new energy vehicles according to claim 1, characterized in that: It also includes a clamping circuit U3 for preventing negative voltage and high voltage from being applied to the MCU sampling pin, and the clamping circuit U3 is connected between R49 and R50.
5. The analog switch expansion multi-channel ADC sampling circuit for new energy vehicles according to claim 1, characterized in that: The analog switch multiple-select-one circuit includes an analog switch chip U11, resistors R66, R67, and the resistors R66, R67 are connected in parallel to the analog switch chip U1.
6. The analog switch expansion multi-channel ADC sampling circuit for new energy vehicles according to claim 5, characterized in that: The model of the analog switch chip U11 is CD4052.
7. The analog switch expansion multi-channel ADC sampling circuit for new energy vehicles according to claim 1, characterized in that: It also includes an MCU minimum system sampling circuit for providing a voltage signal to the analog switch multiple-selection circuit, the MCU minimum system sampling circuit includes a single-chip microcomputer U12, capacitors C26, C27, C28, C29, C30, C31, C32, and a crystal oscillator X1, the capacitors C26 and C27 are connected in parallel and connected to the single-chip microcomputer U12, the crystal oscillator X1 is connected between C26 and C27, and the capacitors C28, C29, C30, C31, and C32 are connected in parallel in sequence and connected to the single-chip microcomputer U12.
8. The analog switch expansion multi-channel ADC sampling circuit for new energy vehicles according to claim 7, characterized in that: The model of the single chip microcomputer U12 is STM32G474RET6.
