FPGA tabanlı, yüksek hızlı sinyal işleme ve fonksiyon üreteci birimi tasarımı
FPGA based, high speed signal processing and function generator unit design
Yazar: ENES ÖZDEMİR
Danışman: DR. ÖĞR. ÜYESİ AYDIN TARIK ZENGİN
İstanbul Teknik Üniversitesi / Lisansüstü Eğitim Enstitüsü / Elektrik Mühendisliği Ana Bilim Dalı / Elektrik Mühendisliği Bilim Dalı
Derece: Yüksek Lisans, 2024
Konu: Elektrik ve Elektronik Mühendisliği = Electrical and Electronics Engineering
Dizin: FPGA = FPGA

Özet:
FPGA'lerin (Field Programmable Gate Array) geniş bir uygulama yelpazesi vardır. Sinyal işleme, fonksiyon üreteçleri ve ölçüm uygulamalarında da önemi giderek artmaktadır. Gelişmiş paralel işlem yetenekleri, yüksek performansları, düşük gecikme süreleri ve özelleştirilebilir donanım yapıları, FPGA'leri bu tür uygulamalar için ideal bir seçim haline getirir. Hassas frekans ve genlik ölçümleri, birçok sistemde kritik öneme sahiptir. Doğru sonuçlar elde etmek için güvenilir ve hızlı bir şekilde yapılması gerekir. Fonksiyon üretimi süreçlerinin doğru şekilde uygulanması da endüstriyel ve akademik alanlar gibi modern teknolojinin farklı birçok alanında oldukça önemlidir.
Sinyal jeneratörü aracılığıyla dışarıdan sinüzoidal formda analog bir giriş sinyali uygulanmaktadır. Bu sinyal ADC (Analog - Dijital Dönüştürücü) aracılığıyla dijital bir sinyale çevrilmektedir. ADC'den aldığımız veriler bir taraftan DMA (Direct Memory Access) ile doğrudan hafızaya yazılmaktadır. Daha sonra DMA'in hafızaya yazdığı değerler arasından sinyalin tepe değeri tespit edilir. ADC'den aldığımız verilerden frekansı bulmak için ise bir frekans sayıcı bloğu kullanılır. En son olarak ölçülen frekans ve genlik tepe değeri verileri çıktı olarak ekranda yazdırılmaktadır.
Tasarımımızı tamamladıktan sonra kurulan sistem üzerinde farklı birçok değerde ölçümler alındı ve uygulanan değerlere yakın sonuçlar elde edildi. Bu da tasarlanan sistemin başarılı bir şekilde frekans ve genlik ölçümünü yerine getirdiğini gösterdi. Uygulanan genlik değerlerinin ölçümleri %3,23 hassasiyetle gerçekleştirildi. Uygulanan frekans değerlerin de ise %0,87 hassasiyetle ölçüm yapıldı.
Çalışmamızın ikinci kısmında FPGA tabanlı bir fonksiyon üreteci birimi tasarımı yapıldı. İstenilen frekans değerine sahip sinüzoidal dalga formunda sinyaller DAC (Dijital - Analog Dönüştürücü) kullanarak oluşturuldu.
Tasarımımızda kullanıcı girişi ile frekans belirlenir. Kullanıcı Vitis programında oluşturulan komut satırında belirli bir frekans değerini girer. Bu frekans değeri, üretilecek sinüzoidal sinyalin frekansını belirler. Kullanıcı tarafından girilen frekans değeri C sürücüsü tarafından alınır. Daha sonra DDS Compiler bloğuna iletilmek üzere uygun bir formata dönüştürülür. Bu dönüşüm işlemi belirli bir formül kullanılarak gerçekleştirilir. İşlemci tarafında çalışan C sürücüsü çalışırken FPGA ile iletişim sağlar ve FPGA'nın belleğine erişir. DDS Compiler bloğuna frekans bilgisi gönderilir. DDS Compiler bloğu belirtilen frekansa sahip sinüzoidal sinyali üretmek için DDS (Doğrudan Dijital Sentezleyici) yöntemini kullanır. Bu yöntem, dijital olarak doğrudan sinyal üretimi yaparak yüksek hassasiyetle birlikte esneklik de sağlar. DDS Compiler bloğundan gelen dijital sinyaller, AXI4-Stream Red Pitaya DAC bloğuna iletilir. Bu blok, dijital sinyalleri analog bir formata dönüştürerek çıkışta sinüzoidal bir dalga formu üretir. Böylece FPGA tabanlı olarak istenen frekans değerine sahip sinüzoidal bir sinyal üretimi gerçekleştirilir.Farklı birçok frekans değerinde sinyaller oluşturuldu ve istenen değerlere yakın sonuçlar elde edildi. Bu da tasarlanan sistemin başarılı bir şekilde sinyal üretimini yerine getirdiğini göstermektedir. Belirlenen frekans değerlerinin üretimi %0.13 hassasiyetle gerçekleştirildi.
Tasarlanan yapı sayesinde yüksek işlem gücü gerektirmeyen, karmaşık hesaplama yapılarına yer vermeden sonuç odaklı pratik bir uygulama ortaya konuldu.

Abstract:
FPGAs (Field Programmable Gate Array) have a wide range of applications. Its importance is also increasing in signal processing, function generators and measurement applications. Their advanced parallel processing capabilities, high performance, low latency, and customizable hardware structures make FPGAs an ideal choice for such applications. Precise frequency and amplitude measurements are critical in many systems. It needs to be done reliably and quickly to obtain accurate results. Correct implementation of function generation processes is also very important in many different areas of modern technology, such as industrial and academic fields.
In the first part of our study, we measure the frequency and amplitude of an externally received analog signal with our FPGA-based design. In our application, we apply signals with a sinusoidal waveform through a signal generator. By processing these signals, we extract properties such as frequency, period and amplitude. Then, we perform frequency analysis and amplitude peak value detection of the signal.
Conventional amplitude and frequency measurement methods; It may have disadvantages such as complex hardware and software requirements, low accuracy and precision, limited frequency range. The FPGA-based method presented in this work offers an innovative and practical approach that provides higher accuracy, precision and wide frequency range. This method can be used in many areas, especially signal processing applications, telecommunications, industrial control, electronic test and measurement, medical imaging, defense, radar systems and more.
Xilinx Pynq-Z2 development board containing FPGA from the ZYNQ 7000 family was used while implementing our application. The card that has been used has a 650MHz Cortex-A9 ARM processor and a Dual 12-Bit 1 MSPS internal ADC (Analog-Digital Converter).
In the study, an analog input signal in sinusoidal form is applied externally through the signal generator. This signal is converted into a digital signal via ADC (Analog to Digital Converter). On the one hand, the data we receive from the ADC is written directly to the memory with DMA (Direct Memory Access). Then, we determine the peak value of the signal among the values that DMA writes to memory. We use a frequency counter block to find the frequency from the data we receive from the ADC. Finally, the measured frequency and amplitude peak value data are printed on the screen as output.
We carried out measurement tests on the system we installed after compliting the design. Amplitude measurement tests were carried out between 0 V and 3.3 V. As a result of the amplitudes applied in 100 mV increments, 33 amplitude value measurements were taken. We carried out our frequency measurement tests between mHz and 500 kHz. Measurements were taken by applying many different frequencies in mHz, Hz and kHz values.
In the second part of our study, an FPGA-based function generator unit was designed. The process of generating a signal with a frequency value determined by the data entered by the user is carried out. Signals in sinusoidal wave form with the desired frequency value are created using DAC (Digital - Analog Converter).
Function Generators are used in many areas such as communication systems, medical devices, electronics, test and measurement, image and audio processing, signal processing, radar and defense systems, sensor systems and industrial applications.
While carrying out this part of our application, Red Pitaya STEMlab 125-14 development board containing FPGA from the ZYNQ 7000 family was used. Our board also includes a Dual Core ARM Cortex-A9 MPCore processor. Our card also has internal ADC (Analog-Digital Converter) and DAC (Digital-Analog Converter). This ADC and DAC feature Dual 14-Bit 125 Msps. The reason why we chose this card in the second part of our application is that it contains an internal DAC.
In our design, the frequency is determined by user input. The user enters a specific frequency value in the command line created in the Vitis program. This frequency value determines the frequency of the sinusoidal signal to be produced. The frequency value entered by the user is received by the C driver. It is then converted to a suitable format to be transmitted to the DDS Compiler (Direct Digital Synthesizer Compiler) block. This conversion process is carried out using a specific equation. While the C driver running on the processor side is running, it communicates with the FPGA and accesses the FPGA's memory. Frequency information is sent to the DDS Compiler block. The DDS Compiler block uses the DDS (Direct Digital Synthesis) method to produce the sinusoidal signal with the specified frequency. This method provides flexibility as well as high precision by digitally generating the digital signals from the AXI4-Stream Red Pitaya DAC. This block converts the digital signals into an analog format and produces a sinusoidal waveform at the output, thus producing a sinusoidal signal with the desired frequency value based on the FPGA.
We programmed our development card after completing the design stages. We then set up the oscilloscope device to examine the analog output signal created by the DAC. Many signals with frequencies determined by user input were generated and examined on the oscilloscope screen. By comparing the frequencies of the produced signals with the desired frequency values; The accuracy and precision of our designed function generator were tested.
Our tests were carried out between 20Hz and 20MHZ to produce signals with the desired frequency values. Many different signals were produced in Hz, kHz and MHz values.
Vivado program was used for system designs. The necessary structures in the Vivado environment were designed with the Verilog hardware description language. Here, the system design is made with a block diagram. The bitstream file required for programming the FPGA was created via this program. At Vivado, we are completing the design of the Programmable Logic (PL) side, that is, the FPGA side of our application. Then, we design the Processing System (PS), that is, the processor side, in the Vitis program using the C programming language, using the file we prepared here. We use this code that we wrote in Vitis to configure and control elements of the hardware design.Measured and produced values were plotted in MATLAB program. We used fitted curve in the graphs. Thus, we tried to show the linearity of our measurements and produced values in our graphs. Accuracy and precision calculations were also made in this program.
We used the absolute error calculation method for accuracy assessment, which shows how close our measurement and production results are to the real values. To evaluate measurement and production precision, we used the standard deviation calculation method. Thus, we determined how much the measurement and production results deviated from the mean value.
In the first part of our study, an FPGA-based measurement application was designed. Frequency measurement and amplitude peak value measurement of the externally applied analogue sinusoidal signal were successfully performed. Measurements were taken at many different values and results close to the applied values were obtained.
For amplitude measurements, the Mean Absolute Error (MAE) was calculated as 0.0091 V and the Standard Deviation value was calculated as 0.0149 V. In frequency measurements at mHz, the Mean Absolute Error (MAE) was calculated as 3.2729 mHz and the Standard Deviation value was calculated as 3.5025 mHz. In frequency measurements at Hz, the Mean Absolute Error (MAE) was calculated as 1.2756 Hz and the Standard Deviation value was calculated as 2.6251 Hz. In frequency measurements at kHz, the Mean Absolute Error (MAE) was calculated as 0.6206 kHz and the Standard Deviation value was calculated as 1.0852 kHz. As a result, the measurements of the applied amplitude values were carried out with 3.23% precision and the measurements of the applied frequency values were carried out with 0.87% precision.
In the second part of our work, an FPGA-based function generator unit was designed. Signal generation was performed in the form of a sinusoidal wave with the frequency value determined by the user. Signals were created at many different frequency values and results close to the desired values were obtained. This shows that the designed system successfully generates signals.
The Mean Absolute Error (MAE) for the signals produced at frequencies in Hz was calculated as 0.1594 Hz and the Standard Deviation value was calculated as 0.1813 Hz. The Mean Absolute Error (MAE) for signals produced at frequencies of kHz was calculated as 0.0951 kHz and the Standard Deviation value was calculated as 0.2161 kHz. The Mean Absolute Error (MAE) for the signals produced at frequencies of 0.0001 MHz was calculated as 0.0001 MHz and the Standard Deviation value was calculated as 0.0004 MHz. As a result, signals were produced at the desired frequency values with an accuracy of 0.13%.
Thanks to the designed structure, a result-oriented practical application that does not require high processing power and does not involve complex calculation structures has been created.
In future studies, signals with different waveforms such as square and saw may be tried in addition to the sinusoidal signal and the study content can be expanded by evaluating different parameters in addition to the signal features that were discussed in the current study.