izpis_h1_title_alt

Sistem za zajem podatkov z vezjem FPGA
ID Gorenc, Žan (Author), ID Žemva, Andrej (Mentor) More about this mentor... This link opens in a new window

.pdfPDF - Presentation file, Download (1,02 MB)
MD5: 5624037874546C83405C3B52FB4BD966

Abstract
V nalogi sem se ukvarjal z implementacijo sistema za zbiranje podatkov. Potrebno je bilo zasnovati program za FPGA-čip na DAQ-kartici in napisati program za prenos in shranjevanje podatkov prek USB-povezave z računalnikom. DAQ-kartica mora odčitati vseh 9 analognih vhodov istočasno, zbrati vse odčitane vrednosti, jih zapisati v serijski niz in jih prek USB-povezave poslati na računalnik. Vzorčevalna frekvenca sistema je fs = 1 MHz. Program FPGA-vezja je napisan v strojno opisnem jeziku \texttt{verilog}. Krmilni sistem sestoji iz štirih modulov, eden služi krmiljenju devetih AD-pretvornikov, eden kot notranji FIFO-pomnilnik FPGA-vezja, kamor začasno shranimo pretvorjene podatke AD-pretvornikov. V vezju je tudi modul za krmiljenje FTDI-čipa, ki je zadolžen za komunikacijo s čipom za prenos podatkov na računalnik. Glavni modul skrbi za upravljanje in nadzor ostalih modulov. AD-pretvorniki za komunikacijo z FPGA-vezjem uporabljajo SPI-protokol, kar pomeni, da mora modul za njihovo krmiljenje dosledno upoštevati zahteve časovnega diagrama AD-pretvornikov, ki ga najdemo v podatkovnem listu [1]. V FIFO-pomnilniku začasno hranimo podatke vseh devetih AD-pretvornikov. Branje iz pomnilnika poteka v času pretvorbe vzorčenih podatkov. Na tiskanem vezju se nahaja tudi FTDI-čip, ki služi kot vmesnik med FPGA-vezjem in računalnikom. Tudi FTDI-čip vsebuje svoj FIFO-pomnilnik, kamor se pred prenosom na računalnik shranjujejo podatki. Ker prenos podatkov poteka enosmerno (FTDI → PC), je dovolj, da nam FTDI-čip sporoča samo, kdaj je pomnilnik za pisanje na čip prost. Glavni modul skrbi za dovajanje urinega signala AD-pretvornikom. Odgovoren je tudi za periodično proženje signala za začetek zbiranja podatkov na 1 MHz, ki zažene celoten proces zbiranja. Upravlja tudi krmilne signale FIFO-pomnilnika FPGA-čipa in pošilja podatke na vhod FTDI-čipa. Prenos podatkov in shranjevanje na PC strani poteka s programom, napisanim v programskem jeziku C++. Pri programiranju sem si pomagal s knjižnico FTD3XX.h. Prenos poteka prek USB-povezave 3.0 z gonilnikom D3XX Direct, ki omogoča komunikacijo med računalnikom in FTDI-čipom. Program je v grobem razdeljen na tri funkcije, glavna je funkcija int main. V funkciji main najprej kličemo funkcijo get_device_info(void), ki skrbi za pridobivanje informacij o povezanih napravah D3XX. Ker FTDI-čip zagotavlja urin signal FPGA-vezju, ga je potrebno ustrezno konfigurirati. To storimo s funkcijo SetChipConfiguration(void). Sledi branje podatkov iz FTDI-čipa, prebrani podatki pa se shranjujejo v tekstovno datoteko. Tekstovno datoteko v programskem jeziku python pretvorimo iz šestnajstiškega sistema v desetiški, preračunamo vrednosti v napetosti s pomočjo prenosne funkcije AD-pretvornikov in podatke ločimo na posamezne pretvornike. Kartica je bila testirana s testnim sinusnim signalom frekvence 10 kHz. Signal je bil uspešno prebran in grafično prikazan. Testirana je bila tudi s pravokotnim signalom frekvence 1 kHz in trikotnim signalom frekvence 500 Hz. Trikotnemu signalu je bila dodana enosmerna komponenta. Tudi ta signala sta bila uspešno prebrana in grafično prikazana.

Language:Slovenian
Keywords:zbiranje podatkov, FPGA-vezje, AD-pretvorniki, FIFO-pomnilnik, FTDI-čip, prenos podatkov, shranjevanje na računalnik
Work type:Master's thesis/paper
Organization:FE - Faculty of Electrical Engineering
Year:2023
PID:20.500.12556/RUL-146446 This link opens in a new window
COBISS.SI-ID:154687235 This link opens in a new window
Publication date in RUL:02.06.2023
Views:595
Downloads:96
Metadata:XML DC-XML DC-RDF
:
Copy citation
Share:Bookmark and Share

Secondary language

Language:English
Title:FPGA based data acquisition system
Abstract:
In this thesis I was working on the implementation of a data acquisition system. The goal was to program the FPGA chip, located on the DAQ card, design a pro- gram for data transfer via USB connection and storing said data on the computer. DAQ card is required to read all of the 9 analogue inputs simultaneously, collect the readings, store them in a serial string and transfer them via USB protocol to the computer. Sampling frequency of the system is equal to fs = 1 MHz. The FPGA program is written in a hardware description language (HDL) verilog. The control system consists of four modules. One is responsible for controlling the 9 AD converters, one serves as an internal FIFO buffer of the FPGA chip, where we temporarily store converted data from AD converters. Another module controls the FTDI chip, which is in charge of communication and transmission of data to the computer. The top module manages and controls the other modules. AD converters use SPI protocol in order to communicate with the FPGA chip, which means that the module controlling them must follow timing requirements consistently, as described in the timing diagram, which can be found in the data-sheet [1]. The FIFO buffer serves as a temporary storage space for data of all nine AD converters. Reading from the buffer is done while the sampled data is being converted. The FTDI chip, located on the PCB, serves as an interface between the FPGA and the computer. It also contains an internal FIFO buffer, where we store data before transmission to the computer. Data transmission is one-way (FTDI → PC), therefore the FTDI chip needs to provide information only about the state of the transfer buffer on the chip. The top module provides a clock signal to all nine AD converters. It is responsible for starting the whole data acquisition process with periodic trigger signal of 1 MHz. It manages the control signals of the FPGA FIFO buffer and sends data to the input of the FTDI-chip. There needs to be some kind of program running on the PC to transfer and store data from the FPGA chip. The program is written in a programming language C++, with the help of FTD3XX.h library that supports communication with the FTDI chip. For that to work we also need to install the D3XX Direct driver. The program consists of three functions. In int main we first call the function get device info(void), which provides information about connected D3XX-devices. The FTDI chip provides a clock signal to the whole FPGA circuit, so we need to configure the chip accordingly, which is done with the function call SetChipConfiguration(void). After configuration is completed, data can be successfully transferred and stored on the drive as a text file. The text file is then converted from a hexadecimal system to a decimal system. The values are calculated to voltages with the help of the transfer function of AD converters. The data is then separated into nine arrays, each corresponding to one AD converter. The card was tested with a sine wave of 10 kHz frequency. The signal was successfully transferred, read and graphically represented. It was also tested with a square wave with a frequency of 1 kHz and with triangular wave with a frequency of 500 Hz. An offset voltage was added to the triangular wave. Both of these signals were successfully read and graphically represented.

Keywords:data acquisition, FPGA, AD converters, FIFO buffer, FTDI chip, data transfer, storing data on PC

Similar documents

Similar works from RUL:
Similar works from other Slovenian collections:

Back