450 likes | 565 Views
Bio potential simulator. Instructor: Evgeniy Kuksin Preformed by: Ziv Landesberg Duration: 1 semester. Introduction.
E N D
Bio potential simulator Instructor: EvgeniyKuksin Preformed by: ZivLandesberg Duration: 1 semester
Introduction Bio potential detector measures the electric potentials on the surface of living tissue . Bio potential detection is useful in many medical application such as ECG, EMG, AND EEG MONITORS. Therefore is also useful to have the ability to test the Bio potential detector by a bio potential simulator.
Project goal • The project goal is to implement a controller of a bio exponential simulator. The controller should control the signal at the output of the simulator.
System description • Material resembling • living tissue FPGA Host • BIO potential • Simulator
Project Block Diagram Sub-LSB Calibration System FPGA HOST Multi-Channel Voltage Generator 128ch@14bit 40KSps
In detailed block diagram Ultra Precision Vref 0.02% accuracy NI FPGA Calibration ADC 4ch@16bit Data/Control Data/Control DAC 32ch@14bit DAC 32ch@14bit DAC 32ch@14bit DAC 32ch@14bit Data/Control 128ch Data/Control Data/Control Sync 5v Return Current PS Isolation X4 * *For Analog crosstalk reduction
FPGA code structure • The code on the FPGA is divided to two main parts. • The first part is the calibration of the DACs m and c registers. This registers should allow to digitally set the slope to 1 and to eliminate the bias. (Did not supply with enough precision) • The second stage is the normal running of the system, which continuously read values from the DRAM and sending them to the D/As.
DACs timings at calibration Wait to host Reg,addres(always changed at same time) value value data Wr’ ldac
ADC timings at calibration Start new cycle at host command sdout write clock read write clock read din sck cnv
Dacs timings at normal runing Repeat 32 times Wait for output stabelize/wanted freq(optional) Wait to busy value value read Reg,addres(always changed at same time) data Wr’ ldac Read next 32 Values from dram
FPGA VI- hierarchy top Dac control Fill dram adc Single write Read 32 dram Rapid write Black-active during calibration Red-active during normal run Purple-active all the time
Fill DRAM • Fill the dram bank given by the host, always. • Each block in dram (64 bit) represents the values of single address on the 4 DAC’s. • The DAC address of a block is cyclic and can be calculated as DAC address=(dram_add-2)mod32 . • The Fill dram can fill a dram bank during the normal running , as long it is not being read at the same time!. • Each bank lasts for 16,777,184 /(32*40000)=13.106[sec]
Rapid-write • Loads all 128 DACs with a sample voltage. • Has 3 states: Wait, Pre-write, Write • “Wait” wait for begin of writing cycle/ until values from memory are read. • “Pre-write” set the values of the data to be written at DACs’ input(wr’ is down) • “Write” write the data(wr’ is up)
Read 32 dram • Read 32 blocks from the dram(128 values). Reads the values to be written at the next cycle of rapid write. • Has 2 main states : • 1- wait for beginning of new writing cycle. • 2- read next 32 blocks from given address and dram bank
Dac control • Control all the operation of the DACS in normal writing. Has 5 states: • “pre dram read” pre dram read- waiting for end of calibration. Once ends the state never reappear • “busy/reading from dram” wait for busy signal and until end of reading values from dram • “pre wrote ” before writing, set the next dram address and the dram bank. • “writing” writing to all DACS outputs • “ldac down-putting ” down ldac begin update of analog output.
Graphs of timing at normal run Timing at dram bank switch
Zoom on graph from previous slide • 5.38 u sec per cycle
ADC • Control the adc- sends samples from wanted channel to host. Responsible for all of the ADC outputs. • Has 2 main states- • 1-reading serial data from the sdout output of the ADC. • 2- waiting until ADC ready to make another sample.
Single write • Write values to one output channel. The values and the channel are set directly by the host.
Zoom on previous graph(5 u sec per cycle) Calibration ADC readout
Creation of Labview socketed clip • The creation of a socketed clip in labview is done by 2 simple stages . • The first one is to wire the I/O signals on the FPGA (agpio) according to the schematics of the project. • The second stage is to fill a XML file that declares names of the signals that can be used by labview.
Calibration method • The calibration we chose use 4th order polynomial fit(software calibration), due to the fact that increasing the order did not improve the error we achieved(as will be shown in next slide). • The ADC uses external reference voltage with value of 5[volt] and accuracy of about 1[mV]. • After calibration DAC output error is less then 1mV FS is 5v maximal error 0.02% (as accurate as ADC) • Before calibration DAC output error is around 10mV FS is 5v error 0. 2% Accuracy Improvement x10
Writing to dram while board is running • It is possible to write to the FPGA dram while it is writing values to the DAC. Is done by control active_dac2_host which says from which bank the fpgacurrentely taking is values(it is not possible to write to that bank) . • by the control dram_host, which says to which bank you want to write. • And by the fifofrom_host, simply by inserting the data you want to write.
Activating 2 FPGA’s • At the last part of the project we inserted second FPGA (also connected to a board) and activated both of them at the same time through PXI backplane triggers. PXI NI FPGA NI FPGA PXI backplane With global triggers for nsecsynchronization
Step signal from 2 FPGA’swithout syncronization One DAC Sample
System Expansion • By expanding and adding more FPGA and DAC boards we can easily get system with above 2000 Analog outputs.
Conclusion-summary • 128 channels analog outputs was successfully implemented. • PCB was manufactured and assembled in china. • PCB-PXI FPGA edge connector appeared 100% correct. Analog Outputs VHDC connector was designed correctly. • Calibration of all analog outputs was implemented and gave wanted 0.02% accuracy. • Slight PCB issues was found, corrected by local wire soldering. • Electrical Parameters Achieved: • 128 channels • All channels synchronized • 0-5v dynamic full scale range • Resolution – 14bit • Sample rate – 40KHz • Accuracy of 1mV (0.02%) • Synchronization of different boards is done by PXI triggers. • FW supports cyclic data transfer from Host to internal 512MB RAM. RAM bank switching allows unlimited data generation.
Test for data Generation • See VIDEO for ECG signals generation. • Data was taken from MIT ECG Arrhythmia Database. • Data is 20sec length. Data was divided into several chunks and was cyclically written to RAM banks.