super_star

2021 Question A-Signal Distortion Measurement Device-Deep Paddling Team

 
Overview
## Foreword

This e-tournament went through many twists and turns and was finally held as scheduled in November. Through 4 days and 3 nights of joint efforts with our teammates, we successfully completed all the indicators for Question A. The completed work mainly consists of the signal pre-processing part, the microcontroller part and the input and output part. The signal pre-processing uses AGC to amplify the signal to a fixed amplitude, and then adds bias to it through the adder. The microcontroller performs FFT through ADC sampling and calculates THD. This system can display information such as signal waveform and frequency amplitude. This system also has functions such as mobile display, voice broadcast, and screen expansion. After final debugging, the system has achieved the basic requirements of the question and performed all the functions. Some indicators are higher than the question requirements, and it has a variety of practical additional functions.

- - -

## Team introduction

The members are all students from the 2018 class of Electronic Information Engineering, Department of Electronic Information and Electrical Engineering, Dalian University of Technology. Among them, the captain, Mr. Liang, is the main technical force, mainly responsible for design and research, and his programming ability is unparalleled. Ao Ge is the main practitioner and is mainly responsible for hardware circuit-related design such as circuit design and construction. Ruirui is a reserve, mainly responsible for assisting the two in completing their missions.

- - -

## Project Analysis

According to [Competition Topic](https://res.nuedc-training.com.cn/topic/2021/topic_31.html), the core of this topic is the production of "Signal Distortion Measurement Device". Basic The requirements are that the peak-to-peak value of the input signal is 300mV~600mV, the fundamental frequency is 1kHz, and the signal distortion range is 5%~50%. It is required to measure and display the THDx value, and the absolute value of the THD measurement error is ≤5%, and the measurement and display time does not exceed 10 seconds.

The play part requires that the input signal range be expanded to 30mV~600mV, the fundamental frequency is 1kHz-100kHz, the normalized amplitude of the harmonics, a periodic waveform of the input signal, and the THDx value need to be measured and displayed, and the THDx error does not exceed 3%. In addition, the input signal THDx value measured by the measuring device, a periodic waveform, the normalized amplitude of the fundamental wave and harmonics need to be displayed on the mobile phone.

By analyzing the question, we can see that the input signal needs to be amplified, limited and biased before it can be collected by the microcontroller. After processing by the microcontroller, the calculated data will be sent and displayed. In addition, we also need to consider the on-chip ADC performance of the microcontroller and the floating point computing capability of the microcontroller. Therefore, after comprehensive consideration, we finally selected MSP432 as the main control unit, with a main frequency of up to 120MHz and a maximum 2Msps, 12bit ADC, which satisfies the question's requirements for the microcontroller. Performance requirements, the following figure is the overall block diagram of the system.

![Snipaste_2021-12-09_14-08-22.png]
The main functions are:

1. Fast distortion measurement, the measurement time is less than 100ms (1KHz input) or 8s (2Hz input)
2. Measurement value display, including signal frequency and amplitude , single-cycle waveform, spectrum
3. Wide measurement range, voltage range 30mV ~ 6V, frequency range 2Hz ~ 190kHz
4. Mobile phone remote display and portable secondary screen

- - -

## Schematic circuit analysis

### Automatic gain control circuit schematic

![image.png]
By adjusting the potentiometer RP1, the final output of the AGC can be adjusted. This module needs to be jointly adjusted with the downstream bias circuit to output a larger amplitude signal to be measured with bias, which can be used by the ADC. Collect measurements directly.

### Circuit diagram of adder and follower

! [image.png]
The adder is used to add bias to the signal to facilitate ADC collection. The follower is used to isolate the AGC feedback voltage when collecting it to prevent the AGC from being damaged when measuring the AGC feedback voltage. module impact.

### MSP432E401Y expansion baseboard schematic

! [image.png]
This baseboard is used to expand TI's official MSP432E401Y development board, leading out buttons, serial ports, ADC and some GPIOs for use.

- - -

## PCB design analysis

is based on the AGC module for signal front-end processing drawn on the schematic diagram. The left side is the input signal SMA socket. Try not to bend the signal line when routing it.

![image.png]
The adder follower PCB is used to add bias to the signal to facilitate ADC acquisition. The follower is used to isolate the AGC feedback voltage when collecting it to prevent the impact on the AGC module when measuring the AGC feedback voltage.

![image.png]
This base board is used to expand TI's official MSP432E401Y development board, and leads to buttons, serial ports, ADC and some GPIOs for use. If you corrode the plate yourself, you can shield unnecessary vias and improve the success rate of plate making.

![image.png]



- - -

## Physical display

! [image.png]
- - -

## Assembly of the work

to connect the power supply and input signal Connect the SMA signal line to the signal generator interface to start measurement. When you need to display the mobile phone or expand the screen display, open the device or application and it will automatically connect and display the measured data and waveform.

- - -

## Programming

### Program Function Description:

It can realize the signal distortion measurement of the input signal under the conditions of 1khz-100khz and amplitude 30mv-600mv. The error of the measurement result does not exceed 3%. And the THD value of the input waveform, the normalized amplitude of the harmonics, the spectrum diagram and the waveform diagram can be displayed on the LCD screen of the measuring device. The results displayed on the LCD screen can also be transmitted to the APP on the mobile phone through the Bluetooth of the measuring device for simultaneous display.

### The program design idea

is to press the measurement button as the starting signal to start measurement. First, ADC1 measures the signal at the highest sampling rate of 2MSps, estimates the frequency of the input signal by counting the number of zero crossings, and lowers the sampling rate according to the signal frequency, successively or Jump down to the most suitable sampling frequency of 500kSps, 125kSps, 31.25kSps, 12.5kSps, 5kSps, 625Sps, and 200Sps. After obtaining a sample with a length of 1024, perform a windowing operation to improve spectrum leakage, then run the FFT algorithm to calculate the spectrum of the input signal, and read the amplitude of each harmonic to calculate the THD and normalization of each harmonic. amplitude. Then the feedback voltage of the AGC is obtained through ADC1, the gain value is calculated through exponential function fitting, and the true amplitude of the input signal is calculated. Finally, the programs of THD display, LCD display of input signal waveform and spectrogram, voice broadcast, and Bluetooth transmission are executed in sequence.

### Program flow chart

![image.png]
- - -

## Summary

Through this e-competition, every teammate has been trained and grown. From the beginning before the summer vacation, they began to prepare drawing boards, positive and negative power modules and adapter boards, stm32H743 expansion boards, AGC, passive filters, and notches. , I have prepared all the imaginable modules for each module, and then each person practiced an e-sports question from previous years. In the process, we also made a lot of progress and learned a lot of experience. The skills of each teammate have also been improved.
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-23 08:50:24

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号