A sine wave signal generating circuit, method and battery resistance meter

By generating high-precision sine wave signals using a microcontroller (MCU) and a high-precision reference voltage source, the high cost and complexity of existing battery internal resistance meters are solved, enabling flexible frequency and amplitude adjustments and improving signal quality and temperature stability.

CN121899682BActive Publication Date: 2026-07-21REPOWER TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
REPOWER TECH CO LTD
Filing Date
2026-03-17
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

The existing 1kHz sine wave signal generation circuit has problems such as high cost, high complexity, poor flexibility and insufficient temperature drift accuracy in battery internal resistance meters, which limits its application in high-end or cost-effective lithium battery testing equipment.

Method used

The microcontroller (MCU) generates a modulated PWM square wave signal, which is combined with a high-precision reference voltage source and a multi-stage active low-pass filter. The high-precision sine wave signal is generated through level conversion and driving circuit, eliminating the need for a DDS chip and a complex frequency division conditioning chain.

Benefits of technology

It reduces material costs and hardware design complexity, improves the flexibility of signal frequency and amplitude, enhances temperature stability and signal quality, and simplifies software development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121899682B_ABST
    Figure CN121899682B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of battery detection, and specifically relates to a sinusoidal signal generation circuit, a method and a battery internal resistance tester, wherein the sinusoidal signal generation circuit comprises: a microcontroller MCU for generating a modulated PWM square wave signal; a reference voltage source circuit for generating a positive reference voltage VREF+ and a negative reference voltage VREF-; a level conversion and driving circuit for converting the modulated PWM square wave signal into a positive and negative level PWM square wave signal with the positive reference voltage VREF+ and the negative reference voltage VREF- as the amplitude; and a sinusoidal conversion circuit, an input end of which is connected to an output end of the level conversion and driving circuit, for converting the positive and negative level PWM square wave signal into a sinusoidal signal and outputting the same. The present application aims to provide a precise sinusoidal signal generation circuit and method for a battery internal resistance tester, so as to solve the problems of complex circuit, high cost, poor flexibility and insufficient temperature drift accuracy in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of battery testing technology, specifically to a sine wave signal generation circuit, method, and battery internal resistance meter. Background Technology

[0002] Currently, there are two main schemes for conventional 1KHz sine wave signal generation circuits.

[0003] like Figure 1 As shown, the first scheme uses Direct Digital Synthesis (DDS) technology, where the MCU configures the DDS chip via the data bus to generate the original sine wave signal, which is then processed by the conditioning circuit. This scheme has the disadvantages of excessive CPU interface resource consumption and high cost of the DDS system.

[0004] like Figure 2 As shown, the second scheme uses an active crystal oscillator to generate a high-frequency reference signal, which is then converted into a 1kHz square wave through analog-to-digital conversion and frequency division, and then converted into a sine wave through a conditioning circuit. This scheme has technical shortcomings such as complex circuit design, poor flexibility due to fixed output frequency, and insufficient temperature drift accuracy.

[0005] A battery internal resistance meter is a key piece of equipment used for battery testing. It primarily assesses a battery's capacity and technical condition by injecting an AC excitation signal into the battery and measuring parameters such as its internal resistance and terminal voltage. It is widely used in battery maintenance, testing, and fault prediction. One of its core components is a 1kHz sine wave signal generation circuit that provides the signal source for the AC constant current excitation source.

[0006] Battery internal resistance meters have specific requirements for signal accuracy, stability, and cost control. The two conventional 1KHz sine wave signal generation schemes mentioned above are insufficient in terms of cost, complexity, accuracy, and flexibility, which limits their application in high-end or cost-effective lithium battery testing equipment. Summary of the Invention

[0007] The purpose of this invention is to provide a precision sine wave signal generation circuit, method, and battery internal resistance meter for use in a battery internal resistance meter, so as to solve the problems of complex circuits, high cost, poor flexibility, and insufficient temperature drift accuracy in the prior art.

[0008] To achieve the above-mentioned objectives, the present invention provides a sine wave signal generating circuit, comprising: A microcontroller (MCU) is used to generate a unipolar modulated PWM square wave signal with a preset frequency and a 50% duty cycle. A reference voltage source circuit includes a reference voltage source and an operational amplifier circuit. The output terminal of the reference voltage source is connected to the input terminal of the operational amplifier circuit to generate a positive reference voltage VREF+ and a negative reference voltage VREF-. The level conversion and driving circuit has its input terminal connected to the output terminal of the square wave signal circuit and the output terminal of the reference voltage source circuit. It is used to convert the modulated PWM square wave signal output by the microcontroller MCU into positive and negative level PWM square wave signals with the positive reference voltage VREF+ and the negative reference voltage VREF- as amplitudes. And a sine wave conversion circuit, whose input terminal is connected to the output terminal of the level conversion and driving circuit, is used to convert the positive and negative level PWM square wave signals into sine wave signals and output them.

[0009] Preferably, the operational amplifier circuit of the reference voltage source circuit includes a first operational amplifier U3A and a second operational amplifier U3B; The output terminal of the reference voltage source is connected to the non-inverting input terminal of the first operational amplifier U3A, and the output terminal of the first operational amplifier U3A is connected to its inverting input terminal and outputs the positive reference voltage VREF+. The output terminal of the reference voltage source is connected to the inverting input terminal of the second operational amplifier U3B through the second resistor R2; the non-inverting input terminal of the second operational amplifier U3B is grounded, and its output terminal is connected to its inverting input terminal through the third resistor R3 and outputs the negative reference voltage VREF-.

[0010] Preferably, the level conversion and driving circuit is a MOSFET push-pull output unit, including a P-channel MOSFET Q1 and an N-channel MOSFET Q2; The source of the P-channel MOSFET Q1 is connected to the positive reference voltage VREF+, and the source of the N-channel MOSFET Q2 is connected to the negative reference voltage VREF-. The gates of the P-channel MOSFET Q1 and the N-channel MOSFET Q2 are connected to the output terminal of the microcontroller MCU. The drains of the P-channel MOSFET Q1 and the N-channel MOSFET Q2 together serve as the output terminals of the level conversion and driving circuit, used to output the positive and negative level PWM square wave signals.

[0011] Preferably, the sine wave conversion circuit includes a multi-stage active low-pass filter, which includes an operational amplifier U4, and a fourth resistor R4, a fifth resistor R5, a sixth resistor R6, a seventh resistor R7 and a third capacitor C3, a fourth capacitor C4, a fifth capacitor C5 and a sixth capacitor C6 connected in its input, output and feedback loops, for converting the positive and negative level PWM signals into sine wave signals.

[0012] Preferably, it further includes an isolation circuit consisting of an optocoupler U1 and a first resistor R1; the isolation circuit is connected between the PWM output pin of the microcontroller MCU and the input terminal of the level conversion and drive circuit, and is used to provide electrical isolation, level conversion and waveform shaping for the modulated PWM square wave signal output by the microcontroller MCU; the optocoupler U1 is connected to the PWM output pin of the microcontroller MCU, and the first resistor R1 is connected to the collector of the output side of the optocoupler U1 as a pull-up resistor.

[0013] Preferably, a DC blocking output circuit is connected to the end of the sine wave conversion circuit; the DC blocking output circuit includes a DC blocking capacitor C7 and an output resistor R8 connected in series, which are used to remove the DC component in the sine wave signal.

[0014] Preferably, the preset frequency is 1KHz.

[0015] Based on the above-described sine wave generating circuit, the present invention also provides a method for generating a sine wave signal, comprising the following steps: S1. A modulated PWM square wave signal with a preset frequency and a 50% duty cycle is generated by a microcontroller (MCU). S2. A positive reference voltage VREF+ and a negative reference voltage VREF- are generated by the reference voltage source circuit; S3. Through the level conversion and driving circuit, the positive reference voltage VREF+ and the negative reference voltage VREF- are used to perform level conversion on the modulated PWM square wave signal to generate positive and negative level PWM square wave signals with positive and negative amplitudes of the positive reference voltage VREF+ and the negative reference voltage VREF-. S4. The positive and negative level PWM square wave signals are filtered and converted by a sine wave conversion circuit to obtain a sine wave signal.

[0016] In another aspect, the present invention provides a battery internal resistance meter, including the above-mentioned sine wave signal generating circuit.

[0017] The beneficial effects of this invention are: it eliminates the need for expensive DDS chips or complex frequency division and conditioning chains, and mainly uses common devices such as MCUs, general-purpose reference sources, MOS transistors and operational amplifiers, which significantly reduces material costs and hardware design complexity; The frequency and amplitude of the sine wave can be flexibly changed by adjusting the PWM frequency output by the MCU and modifying the reference voltage value through software, no longer constrained by fixed frequency crystal oscillators or DDS chips, thus improving system flexibility; An independent, low-temperature-drift, high-precision reference voltage source is used to provide an amplitude reference for the PWM signal, ensuring the amplitude accuracy and temperature stability of the output sine wave from the source, overcoming the shortcomings of large temperature drift in traditional solutions, and significantly improving signal quality. Without the need for complex DDS configuration or frequency division control logic, the MCU only needs to output a PWM wave with a fixed duty cycle, which greatly reduces the difficulty of software development and resource consumption. Attached Figure Description

[0018] Figure 1 The following is a block diagram of the sinusoidal signal generation circuit of the first DDS scheme in the background art; Figure 2 The following is a block diagram of a sinusoidal signal generation circuit for the second active frequency division scheme in the background art; Figure 3 This is a block diagram of a sine wave signal generating circuit provided in an embodiment of the present invention; Figure 4 This is a circuit diagram of the MCU and optocoupler section in an embodiment of the present invention; Figure 5 This is a circuit diagram of the reference voltage source circuit in an embodiment of the present invention; Figure 6 This is a circuit diagram of the level conversion and driving circuit in an embodiment of the present invention; Figure 7 This is a circuit diagram of the sine wave conversion circuit in an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions in this embodiment will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0020] In the description of this invention, it should be noted that the terms "upper," "lower," "inner," "outer," "top / bottom," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0021] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installed," "equipped with," "sleeved / connected," "connected," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0022] A battery internal resistance meter is a key device for battery testing. It primarily assesses a battery's capacity and technical condition by injecting an AC excitation signal and measuring parameters such as internal resistance and terminal voltage. It is widely used in battery maintenance, testing, and fault prediction. However, it has specific requirements for signal accuracy, stability, and cost control. The two conventional 1kHz sine wave signal generation schemes mentioned in the background section have inherent and long-standing drawbacks, including shortcomings in cost, complexity, accuracy, and flexibility, limiting their application in high-end or cost-effective lithium battery testing equipment.

[0023] There are two main paths in the existing technology: DDS and crystal oscillator frequency division. However, due to high cost, high resource consumption, circuit complexity and poor accuracy, this embodiment opens up a third path. It uses the PWM module of a general MCU to generate the basic waveform, and combines it with a high-precision analog reference and filtering to condition it into a high-quality signal. This is a creative improvement with a specific structure that solves the two existing technical paths. Its overall technical effect is unexpected.

[0024] like Figure 3 As shown, to this end, one embodiment of the present invention provides a sine wave signal generating circuit, comprising: A microcontroller (MCU) is used to generate a unipolar modulated PWM square wave signal with a preset frequency and a 50% duty cycle. The reference voltage source circuit includes a reference voltage source and an operational amplifier circuit. The output terminal of the reference voltage source is connected to the input terminal of the operational amplifier circuit to generate a positive reference voltage VREF+ and a negative reference voltage VREF-. The level conversion and driving circuit has its input terminal connected to the output terminal of the square wave signal circuit and the output terminal of the reference voltage source circuit. It is used to convert the modulated PWM square wave signal output by the microcontroller MCU into positive and negative level PWM square wave signals with VREF+ and VREF- as amplitudes. And a sine wave conversion circuit, whose input terminal is connected to the output terminal of the level conversion and drive circuit, is used to convert positive and negative level PWM square wave signals into sine wave signals and output them.

[0025] Specifically, the microcontroller (MCU) generates a standard, unipolar modulated PWM square wave signal with a preset frequency and a 50% duty cycle. Based on the requirements of the battery internal resistance meter, the preset frequency is 1kHz. The frequency and duty cycle parameters of the modulated PWM square wave signal generated by the MCU are accurate and stable, precisely generated by the MCU's internal timer / counter.

[0026] Since the modulated PWM square wave signal output by a microcontroller (MCU) is typically a unipolar digital signal, its high-level potential depends on the MCU's I / O voltage, such as fluctuating between 3.3V and 5V for the high level and 0V for the low level. This level is unsuitable for directly driving subsequent circuit modules and lacks electrical isolation from analog circuits. Therefore, the modulated PWM square wave signal generated by the MCU needs to be conditioned before it can be used in subsequent circuits.

[0027] like Figure 4 As shown, in this embodiment, an isolation circuit is also connected between the PWM output pin of the microcontroller MCU and the input terminal of the level conversion and drive circuit. The isolation circuit consists of an optocoupler U1 and a first resistor R1, which is used to provide electrical isolation, level conversion, and waveform shaping for the modulated PWM square wave signal output by the microcontroller MCU.

[0028] Specifically, optocoupler U1 is connected to the PWM output pin of the microcontroller MCU. The first resistor R1 is connected to the collector of the output side of optocoupler U1 as a pull-up resistor. Optocoupler U1 and the first resistor R1 together constitute the isolation and preliminary waveform conditioning stage. The modulated PWM square wave signal output by the microcontroller MCU drives the high-speed optocoupler U1. The output of optocoupler U1 is used for signal isolation and preliminary waveform shaping, outputting a pre-conditioned modulated PWM square wave signal.

[0029] First, the optocoupler U1 can isolate the ground of the digital control circuit where the microcontroller MCU is located from the ground of the subsequent analog signal generation circuit, effectively preventing noise interference from the digital side from entering the high-precision analog signal link. This is a key design feature for improving system accuracy. Secondly, the modulated PWM square wave signal output by the microcontroller (MCU) drives the LED inside the optocoupler, thereby controlling the conduction and cutoff of the internal phototransistor. The collector of the optocoupler's output side is typically connected to a pull-up resistor R1 to the positive power supply VSS, which can be +5V or VREF+. This results in a modulated PWM square wave signal at the output that is synchronized with the input signal but with a changed voltage amplitude. During this process, the optocoupler performs sequential level conversion on the signal and waveform shaping on the signal edges. This signal serves as the drive signal for subsequent level conversion and drive circuits.

[0030] After initial conditioning, the modulated PWM square wave signal needs further level adjustment before it can be used by the battery internal resistance meter. For this purpose, a reference voltage needs to be provided for the modulated PWM square wave signal.

[0031] In this embodiment, a positive reference voltage VREF+ and a negative reference voltage VREF- are generated by a reference voltage source circuit.

[0032] like Figure 5 As shown, specifically, the reference voltage source circuit includes a reference voltage source and an operational amplifier circuit.

[0033] The reference voltage source uses a reference chip U2, such as REF5025, which provides a high-precision, low-temperature-drift reference voltage VREF. The voltage output of the reference chip U2 is highly accurate, with minimal error compared to nominal values ​​such as 2.5V / 5.0V, and a very low temperature coefficient, i.e., temperature drift. The output voltage fluctuates very little with changes in ambient temperature. For example, a 5V reference with a temperature drift of 10ppm / ℃ means that for every 1℃ change in temperature, the output voltage changes by a maximum of only 5V * 10 / 1,000,000 = 0.00005V = 50µV.

[0034] The reference voltage VREF generated by the reference chip U2 serves as a benchmark for the amplitude of the entire sine wave signal. The accuracy and temperature stability of all subsequent signals, including the positive and negative reference voltages, the amplitude of the PWM signal, and the final sine wave amplitude, are traced back to this reference voltage. Therefore, selecting a low-temperature-drift, high-precision reference source fundamentally ensures the quality of the output signal from the entire signal generation circuit.

[0035] The operational amplifier circuit includes a first operational amplifier U3A and a second operational amplifier U3B. The reference voltage VREF generated by the reference chip U2 passes through the operational amplifier circuit composed of the first operational amplifier U3A, the second operational amplifier U3B, the second resistor R2, and the third resistor R3 to generate precise positive reference voltage VREF+ and negative reference voltage VREF-, respectively.

[0036] Specifically, the output of the reference chip U2 is connected to the non-inverting input of the first operational amplifier U3A, and the output of the first operational amplifier U3A is connected to its inverting input and outputs a positive reference voltage VREF+.

[0037] During the generation of the positive reference voltage VREF+, the first operational amplifier U3A is connected as a voltage follower or non-inverting amplifier, and its output voltage will follow or amplify the reference voltage VREF. Since the reference voltage VREF itself is highly accurate and has low temperature drift, the output voltage VREF+ of the first operational amplifier U3A also inherits these characteristics, becoming a precise positive reference voltage VREF+.

[0038] The output of the reference chip U2 is connected to the inverting input of the second operational amplifier U3B through the second resistor R2; the non-inverting input of the second operational amplifier U3B is grounded, and its output is connected to its inverting input through the third resistor R3 and outputs a negative reference voltage VREF-.

[0039] In the generation of the negative reference voltage VREF-, the second operational amplifier U3B, the second resistor R2, and the third resistor R3 together form an inverting proportional amplifier circuit or inverter. According to the principle of virtual short and virtual open, when the resistance values ​​of the second resistor R2 and the third resistor R3 are equal, this circuit constitutes a unity-gain inverter. At this time, the output voltage VREF- = -VREF. Since the input reference voltage VREF is high-precision and has a low temperature drift, the VREF- generated by the second operational amplifier U3B is a symmetrical, high-precision, and low-temperature-drift negative reference voltage VREF-.

[0040] Therefore, the reference voltage VREF generated by the reference chip U2 can be used to derive a pair of precise positive and negative symmetrical reference voltages from a single reference through the aforementioned reference voltage source circuit.

[0041] After the optocoupler U1 completes the initial isolation and conditioning of the modulated PWM square wave signal, and the reference voltage source circuit generates the positive reference voltage VREF+ and the negative reference voltage VREF-, it is necessary to perform level conversion on the modulated PWM square wave signal to generate positive and negative level PWM square wave signals with the positive reference voltage VREF+ and the negative reference voltage VREF- as the positive and negative amplitudes.

[0042] like Figure 6 As shown, in this embodiment, a level shifting and driving circuit is used to achieve the above functions. The level shifting and driving circuit is a MOSFET push-pull output unit, including a P-channel MOSFET Q1 and an N-channel MOSFET Q2. The push-pull structure composed of the P-channel MOSFET Q1 and the N-channel MOSFET Q2 is a complementary push-pull output stage. Furthermore, the MOSFETs provide strong current output capability, which can drive subsequent filtering circuits.

[0043] Specifically, the source of the P-channel MOSFET Q1 is connected to the positive reference voltage VREF+, and the source of the N-channel MOSFET Q2 is connected to the negative reference voltage VREF-. The gates of P-channel MOSFET Q1 and N-channel MOSFET Q2 are both connected to the output terminal of the microcontroller MCU. With optocoupler U1, the gates of P-channel MOSFET Q1 and N-channel MOSFET Q2 should be connected to the output terminal of optocoupler U1.

[0044] The drains of P-channel MOSFET Q1 and N-channel MOSFET Q2 are used together as the output terminals of the level conversion and drive circuit to output positive and negative level PWM square wave signals.

[0045] In the aforementioned level conversion and driving circuit, the amplitude of the modulated PWM square wave signal output from optocoupler U1 swings between the pull-up power supply and ground, while simultaneously driving the gates of P-channel MOSFET Q1 and N-channel MOSFET Q2.

[0046] When the modulated PWM square wave signal is high, the N-channel MOSFET Q2 is turned on and the P-channel MOSFET Q1 is turned off. The output terminal is pulled to the negative reference voltage VREF- through the turned-on N-channel MOSFET Q2. When the modulated PWM square wave signal is low, the P-channel MOSFET Q1 is turned on and the N-channel MOSFET Q2 is turned off. The output terminal is pulled to the positive reference voltage VREF+ through the turned-on P-channel MOSFET Q1.

[0047] In this structure, the output signal strictly follows the frequency and duty cycle of the input modulated PWM square wave signal. The high level of the output signal is precisely equal to the positive reference voltage VREF+, and the low level is precisely equal to the negative reference voltage VREF-. Since the positive and negative reference voltages VREF+ and VREF- are generated by the high-precision, low-temperature-drift reference chip U2, the amplitude of the modulated positive and negative level PWM square wave signals also has extremely high accuracy and temperature stability. In this way, the unipolar PWM square wave generated by the microcontroller MCU is converted into a high-precision positive and negative level PWM square wave signal whose amplitude accuracy is determined by the positive and negative reference voltages VREF+ and VREF-.

[0048] In the above structure, the MOSFET push-pull circuit acts as a precise, high-speed level converter and power driver, providing high-precision positive and negative level PWM square wave signals for the next step of generating a high-precision sine wave. The MOSFET push-pull circuit, powered by positive and negative reference voltages, converts the digital PWM level into a precisely amplitude-accurate analog PWM signal, ensuring the accuracy of the square wave amplitude and driving capability, and connecting the digital domain with the high-precision analog domain.

[0049] After level conversion of the modulated PWM square wave signal to generate positive and negative level PWM square wave signals with positive and negative amplitudes of positive reference voltage VREF+ and negative reference voltage VREF-, the square wave signal needs to be converted into a sine wave signal for use by the battery internal resistance meter. In this embodiment, a sine wave conversion circuit is used to complete the above conversion action.

[0050] The sine wave conversion circuit includes a multi-order active low-pass filter, whose input is connected to the output of the level conversion and driving circuit. Its parameters are configured to extract and amplify the fundamental component of the preset frequency PWM signal, thereby filtering out higher harmonics and outputting a pure sine wave. In this embodiment, although a second-order active low-pass filter is used to achieve sine wave conversion, third-order, fourth-order, or higher-order active low-pass filters can also be used to achieve waveform conversion depending on the accuracy of the sine wave signal.

[0051] like Figure 7 As shown, specifically, the multi-stage active low-pass filter includes operational amplifiers U4A and U4B, as well as fourth resistor R4, fifth resistor R5, sixth resistor R6, seventh resistor R7 and third capacitor C3, fourth capacitor C4, fifth capacitor C5 and sixth capacitor C6 connected in its input, output and feedback loops, which are used to convert positive and negative level PWM signals into sine wave signals.

[0052] Its cutoff frequency is set around 1kHz, which can effectively filter out high-order harmonics in the 1kHz PWM signal, retain and amplify its fundamental sine component, i.e., the 1kHz sine wave, thereby realizing the conversion from PWM wave to sine wave.

[0053] The sine wave conversion process is as follows: The sine wave conversion circuit receives positive and negative level PWM square wave signals output by the level conversion and drive circuit. According to spectrum analysis, the positive and negative level PWM square wave signals are ideal square waves with amplitudes precisely at +VREF and -VREF, a frequency of 1KHz, and a duty cycle of 50%. Their spectrum consists of a 1KHz fundamental wave and odd-order harmonics such as 3KHz, 5KHz, 7KHz, etc., with the harmonic amplitude decreasing as the frequency increases.

[0054] The cutoff frequency of a multi-stage active low-pass filter is designed to be slightly above 1 kHz. Its frequency response characteristics allow signals below the cutoff frequency to pass through while significantly attenuating signals above the cutoff frequency.

[0055] When a 1kHz PWM square wave is input to this multi-stage active low-pass filter, its 1kHz fundamental component is located in the passband and is retained and passed through, while all higher harmonics such as 3kHz and 5kHz are located in the stopband and are greatly attenuated by the filter.

[0056] Operational amplifiers U4A and U4B provide gain and low output impedance while filtering, enabling them to drive subsequent circuits and further ensuring the smoothness and stability of the sine wave waveform.

[0057] After passing through this multi-stage active low-pass filter, the output terminal, i.e., the output pin of operational amplifier U4B, yields a smooth sine wave with a frequency of 1kHz. However, this sine wave signal may contain a DC bias voltage whose overall center point is not 0V.

[0058] Therefore, the sine wave generation circuit provided in this embodiment also has a DC blocking output circuit connected to the end of the sine wave conversion circuit, which is used to remove the DC component in the sine wave signal and output the final standard AC sine wave signal.

[0059] Specifically, the DC blocking output circuit includes a DC blocking capacitor C7 and an output resistor R8 connected in series. The capacitor C7 and the resistor R8 together form a high-pass filter.

[0060] For the DC component, i.e., the DC bias that may exist in the previous sine wave, capacitor C7 presents extremely high impedance, preventing it from passing. For the AC signal, i.e., the 1kHz sine wave, capacitor C7 presents a certain capacitive reactance, allowing it to pass. Resistor R8, acting as a load resistor or discharge resistor, provides a DC path for capacitor C7, stabilizing the circuit's operating point. Together with capacitor C7, it determines the cutoff frequency of the high-pass filter. This frequency is much lower than 1kHz, for example, 10Hz, ensuring that the 1kHz sine wave can pass without attenuation.

[0061] After DC blocking by capacitor C7 and resistor R8, the DC component in the sine wave signal is completely removed, and the center point of the signal is precisely pulled to 0V. At this point, the signal obtained at the output terminal is a standard, DC-bias-free, high-precision, and low-temperature-drift 1kHz sine wave signal, which can be used to drive a subsequent AC constant current excitation source.

[0062] This embodiment employs an active low-pass filter to extract the fundamental sine wave from high-precision positive and negative voltage PWM square wave signals. Since the amplitude accuracy of the input positive and negative voltage PWM square wave signals is guaranteed by the previous stage, the final filtered sine wave directly benefits in terms of amplitude accuracy, thus achieving accuracy transmission throughout the entire link. The final converted sine wave signal passes through a DC blocking circuit composed of capacitor C7 and resistor R8 to remove any possible DC offset, outputting the final required standard, high-precision, low-temperature-drift 1kHz sine wave signal.

[0063] It should be noted that the embodiments of the present invention directly generate PWM waves through an MCU, combined with a high-precision reference source and a simple level conversion and filtering circuit, achieving the generation of high-performance sine wave signals with extremely low cost and complexity. Those skilled in the art, after understanding the principles of the present invention, can make various modifications, such as changing the PWM frequency to generate sine waves of different frequencies, or adjusting the filter circuit parameters; all such modifications should fall within the protection scope of the present invention.

[0064] Based on the above-described sine wave signal generating circuit, this embodiment also provides a sine wave signal generating method, including the following steps: S1. A modulated PWM square wave signal with a preset frequency and a 50% duty cycle is generated by a microcontroller (MCU). S2. A positive reference voltage VREF+ and a negative reference voltage VREF- are generated by the reference voltage source circuit; S3. Through the level conversion and driving circuit, the positive reference voltage VREF+ and the negative reference voltage VREF- are used to perform level conversion on the modulated PWM square wave signal, generating positive and negative level PWM square wave signals with positive and negative amplitudes of positive and negative reference voltages VREF+ and VREF-. S4. The positive and negative level PWM square wave signals are filtered and converted by a sine wave conversion circuit to obtain a sine wave signal.

[0065] The above-described sine wave signal generation circuit and method can be widely used in battery internal resistance meters, lithium battery testing equipment, and battery pack and module internal resistance testing equipment that require a high-precision, low-temperature drift AC excitation source.

[0066] In summary, the technical solution provided in this embodiment firstly uses a microcontroller (MCU) to generate a PWM square wave with precise frequency and duty cycle. The frequency of the output sine wave is determined solely by the MCU's PWM frequency and can be flexibly adjusted via software. This overcomes the limitation of fixed frequency in active crystal oscillator solutions, making the device more adaptable and solving the problems of frequency flexibility and digital control accuracy. Compared to the DDS solution, it significantly reduces the occupation of MCU interface resources, simplifies software driving, and reduces the overall system resource overhead. Secondly, by introducing an independent high-precision, low-temperature-drift reference voltage source as the amplitude reference for the entire signal chain, the amplitude accuracy and stability of the output signal across the entire temperature range are fundamentally improved, directly addressing and solving the obvious shortcoming of insufficient temperature drift accuracy in conventional technologies. Finally, it completely eliminates the need for expensive DDS chips or high-frequency crystal oscillators and frequency divider chains, achieving the same function using common, low-cost components such as general-purpose MCUs, reference sources, MOSFETs, and operational amplifiers. This significantly reduces material costs, PCB area, and circuit complexity related to design difficulty.

[0067] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A sine wave signal generating circuit, characterized in that: include: A microcontroller (MCU) is used to generate a unipolar modulated PWM square wave signal with a preset frequency and a 50% duty cycle. A reference voltage source circuit includes a reference voltage source and an operational amplifier circuit. The output terminal of the reference voltage source is connected to the input terminal of the operational amplifier circuit to generate a positive reference voltage VREF+ and a negative reference voltage VREF-. The level conversion and driving circuit has its input terminal connected to the output terminal of the circuit that generates the PWM square wave signal and the output terminal of the reference voltage source circuit. It is used to convert the modulated PWM square wave signal output by the microcontroller MCU into positive and negative level PWM square wave signals with the positive reference voltage VREF+ and the negative reference voltage VREF- as amplitudes. And a sine wave conversion circuit, whose input terminal is connected to the output terminal of the level conversion and driving circuit, is used to convert the positive and negative level PWM square wave signals into sine wave signals and output them; The sine wave conversion circuit includes a multi-stage active low-pass filter; The level conversion and driving circuit is a MOSFET push-pull output unit, including a P-channel MOSFET (Q1) and an N-channel MOSFET (Q2). The source of the P-channel MOSFET (Q1) is connected to the positive reference voltage VREF+, and the source of the N-channel MOSFET (Q2) is connected to the negative reference voltage VREF-. The gates of the P-channel MOSFET (Q1) and the N-channel MOSFET (Q2) are connected to the output terminal of the microcontroller MCU. The drains of the P-channel MOSFET (Q1) and the N-channel MOSFET (Q2) together serve as the output terminals of the level conversion and driving circuit, used to output the positive and negative level PWM square wave signals; It also includes an isolation circuit consisting of an optocoupler (U1) and a first resistor (R1); The isolation circuit is connected between the PWM output pin of the microcontroller MCU and the input terminal of the level conversion and drive circuit, and is used to provide electrical isolation, level conversion and waveform shaping for the modulated PWM square wave signal output by the microcontroller MCU.

2. The sine wave signal generating circuit according to claim 1, characterized in that: The operational amplifier circuit of the reference voltage source circuit includes a first operational amplifier (U3A) and a second operational amplifier (U3B). The output terminal of the reference voltage source is connected to the non-inverting input terminal of the first operational amplifier (U3A), and the output terminal of the first operational amplifier (U3A) is connected to its inverting input terminal and outputs the positive reference voltage VREF+. The output terminal of the reference voltage source is connected to the inverting input terminal of the second operational amplifier (U3B) through the second resistor (R2); the non-inverting input terminal of the second operational amplifier (U3B) is grounded, and its output terminal is connected to its inverting input terminal through the third resistor (R3) and outputs the negative reference voltage VREF-.

3. The sine wave signal generating circuit according to claim 1, characterized in that: The multi-stage active low-pass filter includes an operational amplifier (U4), and a fourth resistor (R4), a fifth resistor (R5), a sixth resistor (R6), a seventh resistor (R7), a third capacitor (C3), a fourth capacitor (C4), a fifth capacitor (C5), and a sixth capacitor (C6) connected in its input, output, and feedback loops, for converting the positive and negative level PWM square wave signals into sine wave signals.

4. The sine wave signal generating circuit according to claim 1, characterized in that: The optocoupler (U1) is connected to the PWM output pin of the microcontroller MCU, and the first resistor (R1) is connected to the collector of the output side of the optocoupler (U1) as a pull-up resistor.

5. The sine wave signal generating circuit according to claim 3, characterized in that: A DC blocking output circuit is connected to the end of the sine wave conversion circuit; the DC blocking output circuit includes a DC blocking capacitor (C7) and an output resistor (R8) connected in series, which are used to remove the DC component in the sine wave signal.

6. The sine wave signal generating circuit according to claim 1, characterized in that: The preset frequency is 1KHz.

7. A method for generating a sine wave signal, characterized in that: Based on the sine wave signal generating circuit according to any one of claims 1-6, the process includes the following steps: S1. A modulated PWM square wave signal with a preset frequency and a 50% duty cycle is generated by a microcontroller (MCU). S2. A positive reference voltage VREF+ and a negative reference voltage VREF- are generated by the reference voltage source circuit; S3. Through the level conversion and driving circuit, the positive reference voltage VREF+ and the negative reference voltage VREF- are used to perform level conversion on the modulated PWM square wave signal to generate positive and negative level PWM square wave signals with positive and negative amplitudes of the positive reference voltage VREF+ and the negative reference voltage VREF-. S4. The positive and negative level PWM square wave signals are filtered and converted by a sine wave conversion circuit to obtain a sine wave signal.

8. A battery internal resistance meter, characterized in that: The circuit includes the sine wave signal generating circuit according to any one of claims 1 to 6.