newrudeman

[Beijing Jiaotong University] Qi Dacheng_Differential amplifier circuit tester_Output terminal

 
Overview

This differential amplifier circuit tester uses STM32F411 as the microprocessor. By inputting different signals to the differential amplifier circuit and measuring the amplified signals, it completes the measurement of the amplification factor, input resistance, and amplitude-frequency characteristics of the amplifier circuit. At the same time, the tester can also be used as a sinusoidal differential signal generator, which can generate a sinusoidal differential signal with adjustable frequency and amplitude. The common mode signal is obtained after PWM low-pass filtering, and the differential mode signal is generated by AD9833. At the same time, input the common mode signal and the differential mode signal into the addition and subtraction circuit to output the differential signal. After the differential signal generated by the differential signal source passes through the differential amplification circuit, it first passes through the subtraction circuit to filter the common mode signal, and the resulting differential signal is high-pass filtered, maintained by the peak detection circuit, and then detected by the ADC. STM32F411 is responsible for controlling the measurement process, analyzing and processing the measured data, calculating the input and output resistance and frequency characteristics of the differential amplifier circuit, and drawing the corresponding characteristic curve through OLED to complete the characteristic test of the differential amplifier circuit. This system has the characteristics of low power consumption, low cost, convenient control, friendly human-computer interaction, and stable working performance. It can be regarded as a superior solution for differential amplification circuit tester.

1. System solution design

1.1 Differential signal source 1.1.1 Proposed solution 1: Obtain the DC signal through resistor voltage division, and obtain the DC signal through the voltage follower and the co-directional amplifier. STM32F411 controls AD9833 to generate a sinusoidal signal with adjustable frequency and phase. After following the voltage through a voltage follower, a digital potentiometer is used to divide the voltage. The amplitude of the sinusoidal signal can be controlled by changing the resistance of the digital potentiometer by pressing a button. Input the DC signal and sinusoidal signal into the addition and subtraction circuit respectively, and output the differential signal source.

Scheme 2 STM32F411 controls DDS to generate a sinusoidal signal with adjustable frequency and phase offset. After following the voltage through a voltage follower, a digital potentiometer is used to divide the voltage. The amplitude of the sinusoidal signal can be controlled by changing the resistance of the digital potentiometer by pressing a button. Since the DDS used here can adjust the offset, the DC signal is obtained after low-pass filtering. The DC signal and the sinusoidal signal are input into the addition and subtraction circuits respectively, and a differential signal source with controllable frequency and amplitude can be output.

Option 3: Low-pass filter the PWM signal to obtain a DC signal, and the DC signal value can be changed by controlling the duty cycle. STM32F411 controls AD9833 to generate a sinusoidal signal with adjustable frequency and phase. After following the voltage through a voltage follower, a digital potentiometer is used to divide the voltage. The amplitude of the sinusoidal signal can be controlled by changing the resistance of the digital potentiometer by pressing a button. By inputting the DC signal and the sinusoidal signal into the addition and subtraction circuit respectively, a differential signal source with controllable frequency and amplitude can be output.

1.1.2 Comparison and selection Among the above three options, except for option 2, AD9833 is used to generate differential mode signals. However, option 2 requires fewer DDS chip models that can adjust the offset size, so option 2 is abandoned first. The method of generating common-mode signals in Scheme 1 is to divide the voltage through digital potentiometers. The common digital potentiometers on the market have a 100-level order. The common-mode signal required by the question is exactly 100-level. Therefore, if you want to use digital potentiometers, When the potentiometer divides the voltage, the voltage at both ends of the potentiometer should change within the range, and the accuracy requirement is relatively large. Moreover, any common mode signal input by the user cannot be generated, so option one is abandoned. Solution 3 uses PWM to realize the function of independently adjusting the DC signal value. Here, PWM can be generated by AD9833 or STM32. Taking into account factors such as circuit implementation and code implementation, we believe that using STM32 to output PWM wave is the best solution. Option 3 is a better option.

Considering that the digital potentiometer does not accurately divide the resistance, there will be a certain error in the output of the differential mode signal, and there will also be a certain error in the PWM filtering. The above two errors can be eliminated through software, and the measured The parameters corresponding to different outputs are recorded in the MCU. When a specific signal needs to be output, the comparison table is searched to determine the parameter settings, thus ensuring the accuracy of the output as much as possible.

1.2 The differential signal detection circuit has been actually measured. When the peak-to-peak value of the input signal is 40mV, the output signal will be distorted. Even if the input differential signal amplitude is 100mV, the output differential signal amplitude will not exceed the op amp's amplitude. The power supply voltage is ±5V, so we directly pass the differential signal through the subtraction circuit to obtain the amplified differential mode signal. Considering that the actual amplification circuit is not completely ideal, a second-order high-pass filter is used to filter out DC interference. Then, the voltage is divided by resistors first, and the voltage is adjusted to be within the measurement range of the STM32 ADC before measurement. For differential signal measurement circuits, we have proposed two solutions, namely:

  1. Directly use the ADC to measure the differential signal output, and take the maximum value as the differential signal amplitude.

  2. Pass the differential signal through the peak detection circuit and measure the output of the peak detection circuit

Considering that the maximum frequency of the ADC of the STM32F4 series is 25MHZ, and each sampling should go through at least 3 cycles, if you want to directly measure the amplitude of the AC signal, you may miss the peak value. The measurement result is the average value within 3 cycles, and It is not accurate, and although the measurement speed after 3 cycles is fast, errors may occur, which affects the judgment. Therefore, we choose to use option 2 here: pass the differential signal through the peak detection circuit and measure the output of the peak detection circuit.

Due to the limitations of the traditional peak detection circuit, it is difficult to discharge the stored voltage after detecting a signal with a large amplitude, so a pressure relief circuit controlled by a three-stage tube is added as shown in Figure 1-1. valve to achieve the "reset function" of the peak detection circuit. Through this pressure relief valve, the MCU can "reset" the peak detection circuit before each measurement to wait for the next detection.

1.3 Measurement of differential amplifier circuit parameters This differential amplifier circuit characteristic tester should be able to measure four parameters: amplification, input resistance, amplitude-frequency characteristics, and upper limit cutoff frequency. A simple analysis of its measurement method shows that the measurement of amplitude-frequency characteristics is Measure the amplification factor at different input frequencies. The measurement of the upper limit cutoff frequency is to find the frequency in the amplitude-frequency characteristics that satisfies the amplification factor as multiple of the intermediate frequency amplification factor. Therefore, the measurement of the above four parameters can be simplified into the measurement of two parameters. They are: amplification factor and input resistance.

1.3.1 Measurement of amplification factor For the measurement of amplification factor, you should first operate the differential signal source to output a differential signal with specified parameters, and then start the pressure relief valve to release the stored voltage. When the voltage in the peak detection circuit is released, close the pressure relief valve. After waiting for the output of the detection circuit to stabilize, measure the output. Calculate the actual amplified differential mode signal amplitude through this output, and divide it by the input differential mode signal amplitude to obtain the amplification factor.

When measuring the actual amplification factor of the circuit, it should be ensured that the output differential mode signal will not be distorted. After actual measurement, it is more appropriate to select an input signal with a peak-to-peak value of 30mV to measure the amplification factor.

1.3.2 Measurement of input resistance Since there is no DC blocking capacitor at the input end, adding a resistor directly to the input end will cause the input resistance of the amplifier circuit to change. In order to reduce the error caused by this change, the resistance value of the added resistor should be reasonable. Through actual measurement, the input resistance is about 10k, so here we add a 1k resistor to measure the input resistance.

Ignore the impact of adding a resistor on the amplifier circuit, and measure the change in amplification factor of the amplifier circuit before and after adding the resistor. Before adding the resistor, the measured amplification factor is the actual amplification factor of the amplifier circuit. After adding the resistor, the measured amplification factor should decrease to a certain extent. This is because the actual signal input to the amplifier circuit has been divided into times the signal output by the differential signal source, while the amplification factor of the actual amplifier circuit should remain unchanged. Note that the magnification of the first measurement is , and the magnification of the second measurement is , so the following equation can be listed:

The input resistance of the amplifier circuit can be obtained through simple calculation.

2. Theoretical analysis and calculation 2.1 Differential signal source 2.1.1 Second-order active low-pass filter

The square wave signal generated by STM32F411 is converted into a DC signal after being passed through a second-order active low-pass filter. Figure 2-1 is the schematic diagram of the second-order active low-pass filter.

gain, so it should be shorted.

Cut-off frequency:

The parameter selection is R1=R2=2kΩ, R3=1kΩ, C1=2μF, C2=1μF, and R4 is short-circuited. gain, so it should be shorted.

Cut-off frequency:

The parameter selection is R1=R2=2kΩ, R3=1kΩ, C1=2μF, C2=1μF, and R4 is short-circuited.

2.1.2 The sinusoidal signal with DC bias generated by the second-order active high-pass filter AD9833 is passed through the second-order active high-pass filter to remove the DC bias. Figure 2-2 is the schematic diagram of the second-order active high-pass filter.

Gain: , so it should be shorted

Cut-off frequency:

The parameter selection is R1=2.2kΩ, R2=1.1kΩ, R3=1kΩ, C1=C2=10uF, and R4 is short-circuited.

2.2 Differential signal detection circuit 2.2.1 Peak detection circuit

The circuit in Figure 2-4 is used to capture the peak value of the input voltage (IN). When IN is positive, D1 is reverse biased, D2 is forward biased, and no current flows in feedback resistor R2. As a result, the output voltage (OUT) tracks the input voltage (IN), and the external feedback loop drives the input of U1 to a virtual short circuit. At this time, U1 quickly charges C1. Since U2 is configured as a voltage follower, the output voltage tracks the voltage on capacitor C1. C1 is charged to this voltage by U1's output current through D2. R1 is responsible for preventing U1 from exceeding its short-circuit output current and isolating U1 from C1's capacitance, thus preventing ringing or even oscillation. Therefore, this circuit can maintain the output voltage (OUT) as the maximum input voltage.

Parameter selection: R1=100Ω, R2=1KΩ, C1=10nF, U1 and U2 are NE5532.

3. Circuit and program design 3.1 System composition This system consists of 5 parts, as shown in Figure 3-1, which are data processing system, data input system, display system, differential signal source system, and differential signal detection system.

The data processing system mainly consists of STM32F411, which is responsible for data processing. The data input system mainly consists of a matrix keyboard, which is responsible for completing the operation of users entering data into the system. The display system is mainly composed of an OLED display screen, which is responsible for displaying the results on the screen. The differential signal source system is responsible for receiving the requirements given by the data processing system and generating corresponding differential signals. The differential signal detection system is responsible for detecting the differential signal output and passing the data to the data processing system.

3.2 Differential signal source 3.2.1 Schematic diagram

3.2.2 Simulation results Figure 3-2 shows the output waveform of the differential signal source when the sinusoidal signal amplitude is 600mV and the PWM duty cycle is 90;

Figure 3-3 shows the output waveform of the differential signal source when the sinusoidal signal amplitude is 200mV and the PWM duty cycle is 30.

3.3 Differential signal detection circuit

3.3.1 Schematic diagram

3.4 Workflow chart Considering that STM32 cannot run in parallel with multiple threads, it will be unable to respond to user keystrokes during testing. Our team designed the program to reduce the single-thread blocking time as much as possible to provide smoother human-computer interaction and More comfortable UI interface.

3.4.1 Measurement of magnification

When the differential signal source will continue to output a differential signal, start measuring the amplification factor. First open the pressure relief valve, release the voltage stored in the peak detection circuit, and then close the pressure relief valve. Wait for the output of the detection circuit to stabilize, read the amplified voltage, and divide it by the set parameters to calculate the amplification factor. The specific process is shown in Figure 3-6:

3.4.2 Measuring the parameters of the differential amplification circuit When measuring the parameters of the differential amplification circuit, you should first adjust the input signal parameters and measure the amplification factor at this time. After the measurement, connect a 1K resistor and measure the amplification factor again. Use and combine the parameters in 1.3.2 Give the formula to calculate the actual input resistance of the differential amplifier circuit.

After completing the above measurements, adjust the input signal frequency to 1000HZ, with a peak-to-peak value of 30mV, and start frequency sweeping with a step size of 1000HZ to draw the amplitude-frequency characteristic curve. When it is found that the amplification factor drops to 0.707 times, the dichotomy method is used to continue to search for the upper limit cutoff frequency, that is, the step size is continuously reduced to 1HZ to ensure that the theoretical error of the obtained upper limit cutoff frequency is within 1HZ.

Of course, the above magnification measurements should use the measurement method introduced in 3.4.1 to ensure the accuracy of the measurement.

  1. Test plan and test results 4.1 Test the differential signal source When testing the differential signal source, directly use wires to connect the two outputs to channels 1 and 2 of the oscilloscope, and use the subtraction operation in the math function of the oscilloscope to observe the differential to single-ended signal , compare the differential mode signal amplitude measured by the cursor with the actual set differential mode signal amplitude to determine whether the output differential mode signal meets the requirements.

Figure 4-1 shows the amplitude of the actual differential mode signal when the output differential mode signal is set to 50mV. At this time, the error is 2mV, which meets the requirements. Using this method to continue measuring, we can conclude that the differential signal source we calculated meets the design requirements.

4.2 Test the differential signal detection circuit. Use an oscilloscope to measure the actual output of the differential amplifier circuit and the output after passing through the peak detection circuit, as shown in Figure 4-2.

Extrapolate the output of the peak detection circuit to the actual output, and calculate the error between the two. After multiple calculations, take the average and get: the difference between the output of the peak detection circuit and the actual circuit output is about 2.3mV, which is within the acceptable range.

4.3 Test system function Use wires to connect the tester and the circuit under test, and perform tests multiple times. Calculate the total time for a complete measurement, record the measurement results obtained from each measurement, and calculate the variance. The average system time measured was 23.4s.

It can be seen from the measurement results that the system runs quickly, and the variance of each parameter is small under different measurements. This shows that the system operates stably and the measurement result deviation is small.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-22 02:56:28

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号