Saturday, May 15, 2010

TIA status and Software Update

TIA Update:
Since I haven't updated in so long I need to address some of the issues we had with the TIA and how we fixed them.

Initially we had implemented the TIA section using the OPA350 chip. The problem with using this chip was that it could only deliver a differential output voltage of 7 volts. As our POX board is designed with a VCC of +5v and VEE of -5v this chip wasn't right. Therefore, we tried implementing it with a more expensive chip, the OPA121. A problem was quickly encountered with this chip though. This chip requires use of trim offset to and as our layout leaves these nodes floating it simply would not work. Instead, we switched to a AD795 which finally worked.

Upon testing with a feedback resistor of 500k (expected gain of around 1e-6*500e3 = 500 mV) I found that there existed considerable overshoot/ringing occuring. I knew that I needed to compensate the gain stage as the Phase Margin was too close to zero causing instability in the loop. I kind of guessed on the first value picking 100 pF. I noticed that the ringing was depressed but still occurring. I therefore changed it to 50 pF and found that the ringing all but went away.

The signal amplitude was to small to discern the pulse. I changed the feedback resistor to 4 megaohm. I once again observed ringing so I divided the capacitance by 8. I know this isn't an exact science so I figured brute force method like this was appropriate.

I was able to clearly discern the pulse when looking on the scope but am thinking I could perhaps even provide more gain. This week I will try further increasing the gain to perhaps 6 megaohm.

Software Update:
Most of my effort in the past 3 weeks has been focused on development of the integrated software solution. When I last updated I had implemented a SubVI capable of taking an array of integer ADC values and producing a DC offset value. In this entry, I'd like to update with success and challenges faced in implementing the ability of DC subtraction and PGA gain.

First, it was rather hard to debug this program. The JTAG debugger will not pass back array contents to the front panel so there was no real way to verify if the data was being correctly stored. I ended up testing that data was in fact being stored in an array by using the OLED screen to print random indexes in the array and matching them up with a Oscilliscope output. Later, a program developed by our T.A. Cevin allowed us to send this array data over the micro controller TCP/IP to a local computer on a network. This will be a very cool addition to the program as it will allow us show the user their pulse in real-time.

Having cleared the hurdle of DC tracker I now wanted to implement the DC subtraction. The route I decided to go was to slowly decrement or increment the DC offset based on the current DC offset from the IIR filter. The problem I found with this solution was speed. It's just way to slow to decrement or increment the DC value based on current input. A solution I came up with was to quickly change by 20 if we're far away but to change by 2 or 3 if we're close (say within 25 of 2048 (2.5v)). This solution seems to work ideal, in my tests on different sinusoids of amplitude 100 mV, 200 mV, 500 mV, and 1 V it seems to get a lock to 2.5v within 10 seconds. I've attached a video of the program in action.


http://www.youtube.com/watch?v=olOcnDb8L2A

Having completed this I moved onto the PGA code. This was rather simple to implement as I used the PGA simulation from an early blog post. I quickly found that the ideal environment however simply did not work on the micro controller.

What I initially had envisioned was that the program would provide enough gain and then recenter the signal back to 2.5v. After a little bit of debugging I found that changing the DC bias from where I initially provided gain would move rapidly move the DC rapidly back and forth. This makes sense because there exists DC on the line when I provide the gain so adjusting the DC (even a small amount) will get amplified by the gain set on the PGA. As a solution to this problem I simply prevent and DC subtraction after a gain is provided. I think this is a fine solution as long as frame based processing is being used. This means that whenever a new frame is taken the program must calculate an appropriate gain.

There is a tremendous amount of work that needs to be done with the software. Right now it's perhaps to aggressive. I did testing and found that sometimes it gets really close to rail and clips or even saturates. I'll need to fix this in the coming week. I also need to start testing this on a real PPG signal instead of a sine wave.

In the coming week I will first examine an ideal PPG signal provided by function generator and then try out our actual signal.

I'll update on Monday with our teams goal for the upcoming week.

No comments:

Post a Comment