MartinFowler

2021 Question A-Signal distortion measurement device

 
Overview
### Project Introduction This work designs and implements a distortion measurement device for periodic signals with a signal processing circuit that amplifies distorted small signals as the core. Firstly, hierarchical amplification bias is used to collect positive and negative voltage signals of any amplitude within the range, and then the FFT algorithm is used for spectrum analysis; the DMA mode of the 14-bit ADC of MSP432P is used to complete the sampling of the distorted signal, and the high-order signal is sampled through FFT transformation. Measurement of harmonic amplitude; and a FIR digital filter is designed to filter out the fundamental wave and amplify the harmonics individually to improve the total harmonic distortion (THD) measurement accuracy. The work can display the signal period, THD measurement value and normalized amplitude in real time on the serial screen, and can be displayed simultaneously on the mobile terminal through the ESP32-WIFI module. Actual measurements show that this product can measure distortion signals of 10mv-600mv, 1kHz-150kHz, and the relative error of THD measurement is less than 3%. Basic functions and expanded functions have been realized, and the maximum measurable frequency has been broadened based on the expanded functions.
## Project requirements![)2M$6FF97~28DUU14J50LE.png] ![0)7967RI)BG_O(2_AN55%MP.png] ~~~~ - - - ### Project function introduction Introduction and introduction to the related functions of the project , such as: * The amplifier part uses low-temperature drift fixed resistors to ensure system stability; * Uses high common-mode rejection ratio and low-noise high-bandwidth operational amplifier to reduce distortion caused by signal processing; * The connector uses SMA to reduce the external environment Interference* PCB design uses copper paving and stitching holes to further reduce environmental interference* Perform LC filtering on the power supply before supplying power to the device to ensure the stability of the power supply voltage* FFT algorithm is used to add windows, and the adc sampling value is software filtered to reduce Measurement error ### Circuit explanation The input signal first passes through the in-phase proportional amplification circuit, and then passes through a DC biaser to adjust the input signal to the range that can be collected by ADC, and then is sent to the msp432 microcontroller for ADC collection and then FFT is performed. After software filtering, Add a window, and send the data to the serial port screen for display after fitting. ![Picture.png] - - - ### Software```` C //################# ################################################ ######## // // FILE: adc.c // // TITLE: C28x ADC driver. // //################### ################################################ ###### // $Copyright: $ //################################### ##################################### #include "adc.h" //** *************************************************** ************************* // // Defines for locations of ADC calibration functions in OTP for use in // ADC_setMode() ONLY. Not intended for use by application code. // //**************************************** ************************************* // // The following functions calibrate the ADC linearity. Use them in the // ADC_setMode() function only. // #define ADC_calADCAINL 0x0703B4U//adc register address #define ADC_calADCBINL 0x0703B2U #define ADC_calADCCINL 0x0703B0U #define ADC_calADCDINL 0x0703AEU // // This function looks up the ADC offset trim for a given condition . Use this // in the ADC_setMode() function only. // #define ADC_getOffsetTrim 0x0703ACU //****************************** ************************************************ // // ADC_setMode // //************************************************ ************************************ void ADC_setMode(uint32_t base, ADC_Resolution resolution, ADC_SignalMode signalMode) { // / / Check the arguments. // ASSERT(ADC_isBaseValid(base)); // // Check for correct signal mode & resolution. In this device: // Single ended signal conversions are supported in 12-bit mode only // Differential signal conversions are supported in 16-bit mode only // if(signalMode == ADC_MODE_SINGLE_ENDED)//Turn on rule conversion mode { ASSERT(resolution == ADC_RESOLUTION_12BIT); } else { ASSERT(resolution == ADC_RESOLUTION_16BIT);//Use 16-bit adc collection } ``` - - - ### The circuit schematic diagram and pcb are as shown in the figure, which is a DC adder that adds a DC bias to the entire signal. ![VY%GUBPTX0E)7%QTL_%S0)X.png] ![~U_MBGC8GCDSUP8WIGCZ(WY.png] High bandwidth low noise amplifier schematic and pcb ![5B5K}NXUR6F)V{CR73)K3.png] ![ VN7H864K_6IMNFD8$MI}7Q}YV~UF.png] Source of DC biaser: Self-made, the project file has been uploaded! [9079F8A1C568A9D7FCD5F8E45B712C9E.jpg] The following is the actual picture 1. High-bandwidth low-noise amplifier (with a shield) Source: The circuit purchased on Taobao is a non-inverting proportional amplification, and OPA1611 is selected as the amplifier The chip can be homemade! [7B7514F0FED9D78CC6E0C86A9E0F2FA5.jpg] Main control MSP432P401R Source: TI official website application! [FE54CF6E328B1EA1974FC6D82363DB39.jpg] Connection relationship of each module: After connecting the power supply to each module, the signal passes through the high-bandwidth low-noise amplifier and then enters the DC biaser. Then it is sent to the adc for collection, and after Fourier transform processing, the data is sent to the serial port screen for display under the control of the main control chip. Physical assembly drawing! [AF17BFDD19100348B1FB5BEBA1E4A75D.jpg] - - - ### Demonstration video [https://www.bilibili.com/video/BV1xL4y1E75W?share_source=copy_web](https://www.bilibili.com/video/BV1xL4y1E75W ?share_source=copy_web) - - - ### Notes 1. The power supply voltage is +-5V 2. Wait for the wifi to connect to the mobile app before starting work
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-12 06:42:32

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号