张三叔

Signal distortion measuring instrument

 
Overview
## ****1. Preface**** Realized the distortion measurement based on msp432 and won the first prize in the country. ## ****2. Personal introduction**** Two are majoring in communication engineering in 2019 and the other is majoring in electronic information engineering in 2020 ## ****3. Project analysis**** Design and production signal distortion Measurement device for periodic signals from function/arbitrary waveform generators. ![nYzzR6QlpmUMso5Il9YF6nPZPMl3BbICY1u7udoR.png](https://image.lceda.cn/pullimage/nYzzR6QlpmUMso5Il9YF6nPZPMl3BbICY1u7udoR.png)
![zSROVZ2uOAjjpOwVOwDgMVTLIJZ1BkuFJQuJ ​​jRjA.png](https://image.lceda.cn/pullimage/zSROVZ2uOAjjpOwVOwDgMVTLIJZ1BkuFJQuJjRjA.png)
![0cEId5aPkR0cLJnHe1Abb3uZ0NxDSmFivJp6U8eO. png](https://image.lceda.cn/pullimage/0cEId5aPkR0cLJnHe1Abb3uZ0NxDSmFivJp6U8eO.png)
1. System introduction This system is controlled by MSP432 MCU. The main function flow chart is shown in Figure 8 below. In its main function, the amplification circuit is first selected, and then the on-chip ADC acquisition is started. After the collection is completed, FFT calculation and spectrum correction are performed, and the data of the fundamental wave and harmonics are calculated, and finally handed over to the mobile phone through the serial port and displayed on the serial port screen 2. System·Flowchart! [Picture.png] ## **4. Principle Diagram circuit analysis** 1. Follower circuit diagram
![PC$UF%ENHZWYAKBDUNHD@HD.png] ![(31S95)38JXCHU%{8P_7@}R.png] 2.AD637 effective value module source: Taobao purchase![E3F4599992FB33FC7788ABA4BAA77326 .jpg] Non-inverting proportional amplifier (adjustable gain) Source: Homemade! [1A99201158186E487EE0AF7B29B7021B.jpg] Main control chip MSP432 Source: TI official website application! [88F32966CE0723D2F2F7FDBA5A95A790.jpg] Follower module physical picture Source: Homemade! [280F06 C5CC54AA7041FABEDE576FC39D.jpg] Connection Relationship: The signal flows into two channels. One channel passes through the follower and is sent to the AD637 for effective value detection. The other channel passes through the amplifier and adder and is sent to the adc of the main control chip msp432, and then is controlled by the serial port screen for waveform display. ## 6. Error analysis In the system, there are three main sources of errors: 1) In the ADC acquisition front-end of the system, operational amplifiers are used for some signal amplification and transformation. There are flatness characteristics of the amplifier passband, noise and harmonic distortion. Characteristics such as these will produce errors. 2) In ADC sampling, it is required to satisfy the Nyquist sampling theorem, that is, the sampling frequency is greater than twice the highest frequency of the analog signal to reduce or eliminate the aliasing effect. 3) There are also errors when using the FFT algorithm in a microcontroller. Sampling and calculating the signal requires an infinite sequence to calculate an infinite spectrum. In practice, only part of the waveform sequence can be collected for calculation, which will cause spectrum leakage effects and errors; in discrete FFT transformation, due to the discreteness of the time domain, the frequency domain is also discrete, which will cause the fence effect. In discrete FFT transformation, Frequency points other than this point cannot be measured. In response to the above errors, the solutions are as follows: 1) Construct an amplification circuit by using a high-precision, low-noise operational amplifier chip; connect a capacitor across the power input end to filter out high-frequency clutter pulses brought by the power grid, which will reduce the clutter. Interference in electronic circuits. 2) Try to satisfy the sampling theorem and use high-resolution ADC appropriately. 3) Corresponding to frequency leakage, the corresponding window function can be added, such as the Blackman window function; corresponding to the fence effect, the frequency resolution can be appropriately improved and zero padding and other operations can be performed. At the same time, try to ensure that the required frequency component is an integer multiple of the frequency resolution. ## 7. Summary After four days and three nights of electronic competition, my biggest feeling is that I have to persist until the last moment. Even if the work is not completed for only a few hours, I should not give up hope of adjusting the work. The topic we chose was more about software. It happened that some of the modules I made before the competition could be used. Before the competition, I also spent a long time studying the stability of layout and wiring, and prepared some for the competition. The basics of hardware are done. Because the selected topic is very challenging for the students who write code, and the workload is also large. In comparison, the students who do hardware seem to be more leisurely, but we cooperate with each other, and we are not scratching our heads. We are all working together with the software students. After adjusting the code, many peripherals were finally adjusted. As for the sleep problem during the competition, we stayed up late for the first two days in order to have clear coding ideas, and had a normal schedule. I think the worst thing to do when it comes to software difficulties is to stay up late and code. If it happens to be corrected, it's fine. If not, it will not only affect the next code ideas, but also affect confidence. As for the question of topic selection, due to the limitation of knowledge, we are left with only questions A and H (analysis of electrical appliances). We have not been exposed to the microcontroller used in question A before, but the idea is clear and the signal processing method is We are very familiar with it, the difficulty lies in adjusting the code. As for question H, this part is rarely involved in normal training. Considering all things considered, we chose question A, which means that we need to quickly get started with this microcontroller in four days and three nights. Considering all things considered, we still prepare to study on site. This microcontroller, so I chose question A. In addition, I think that being able to complete all the requirements of this topic is inseparable from a good coding idea. On the last night, because the sampling rate was not easily determined automatically, I happened to see two buttons on the board, so I suggested just I started using two buttons to correspond to different sampling rates. Because I struggled with the button part for a long time during the winter vacation, I quickly gave this part of the code to my software classmates to complete, and finally successfully adjusted the code. Finally, we also need to thank the seniors for their guidance and the persistence of our teammates, which allowed us to win this award## 8. Demonstration video [https://b23.tv/tHL3gzn](https://b23.tv /tHL3gzn) ## 9. The software part description project has been uploaded to the attachment. Now some key codes will be explained.`` int Key_pres=0; //Switch the range by pressing the key while(1) { while(Key_pres==0) ​​{ Key_pres=KEY_Scan(0); } if(Key_pres==1) { //Sampling rate 500K ADC_Single_Init_500K(); printf("500Krn"); BEEP_ON; delay_ms(60); BEEP_OFF; } //Sampling rate 1M if(Key_pres ==2) { ADC_Single_Init_1M(); printf("1Mrn"); BEEP_ON; delay_ms(60); BEEP_OFF; } /************ Serial port screen display************ *******/ sprintf((char *)send, "t0.txt="Ê§Õæ¶È£º%.3f %c"xffxffxff", THD, '%'); USARTA2_SendString(send); sprintf((char *)send, "t1.txt="2´Î¹éÒ»»¯£º%.3f"xffxffxff", (UO2/UO1)); USARTA2_SendString(send); sprintf((char *)send, " t2.txt="3´Î¹éÒ»»¯£º%.3f"xffxffxff", (UO3/UO1)); USARTA2_SendString(send); sprintf((char *)send, "t3.txt="4´Î¹éÒ» »¯£º%.3f"xffxffxff", (UO4/UO1)); USARTA2_SendString(send); sprintf((char *)send, "t4.txt="5´Î¹éÒ»»¯£º%.3f"xffxffxff ", (UO5/UO1)); USARTA2_SendString(send); sprintf((char *)send, "cle 1,0xffxffxff"); USARTA2_SendString(send); flag_period = 1024 / FFT_MAX; for(i=0; i
`` `
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-19 10:58:41

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号