DNA Melter Improvements

From Course Wiki
Jump to: navigation, search

This page catalogs improvements made to the apparatus for the 20.309 DNA Melting Lab Module.

SNR Results

Summary

TODO: make these results happen.

Old Photodiode + Amp OPT101
Unstabilized Optics w x
Stabilized Optics y z

Details and other crap

The SNR measurement/calculation works now (the code was calculating RMS Error wrong; SCW corrected code is on my WinAthena profile; code on Stellar and in course share is incorrect).

Now I'm starting with an SNR of 12.6 / adjusted SNR of 11.7. This is crappy. I need to improve it.

Optimizing SNR with monolithic photodiode-amplifier

  • Initial measurement: 12.6/11.7. This is shitty. But it was with a dead sample.
  • Got rid of old cable to connect OPT101 to breadboard (it was just three wires twisted together, with no shielding); replaced it with same shielded cable that is used for the DAQ connections: 36.2/34.0
  • Replaced old cable, but remembered to adjust phase this time: 35.4/32.5
  • Adjusted optical system: 48.2/43.5
  • Adjusted optical system further, turned room lights off, and added +2mV to offset to eliminate zero jaggies in LED drive wave: 52.2/47.3
  • Added metal shim to raise sample into center of optical path; rearranged optics with everything closer to sample: 51.1/47.0
  • Same as last, but remembered to place cardboard to block direct illumination: 51.4/47.5
  • Removed shim, left optics close to sample: 52.4/48.6

OK so I think the optics are fine where they are and the shim idea can wait.

Getting it to work with the old photodiode

  • I get these weird, non-sinusoid-shaped waveforms. I somewhat suspect that the amplifier I built is to blame. I have not yet gotten good results with it. Need to test it. I'm tired -- will do later.

Forced Cooling

Diagram of heating control with H-bridge and multiplexers.

Circuit Part

Refer to Wikipedia for a basic explanation of the H-bridge motor controller circuit, which can drive a motor forwards or backwards, or let it 'free-run'. The TEC works like a motor, in the sense that if you apply voltage in one direction, one side gets hot and one side gets cold; if you apply voltage in the other direction, the hot side and the cold side are reversed; if you apply no voltage, the TEC does nothing and eventually reaches room temperature.

We can use an H-bridge to allow both forced heating and forced cooling of the sample block, instead of being stuck with passive cooling. TODO: circuit diagram and how the DAQ wiring has to change.

H-bridge datasheet

ACCOMPLISHED: got H-bridge to act the same as the relay, with an unmodified LabView VI. Wooo! Now need to get rid of noise in RTD and photodiode inputs from rapid switching.

Driving with a Multiplexer

Multiplexer datasheet This multiplexer takes two digital signals from the DAQ and translates them into a different set of digital signals to drive the H-bridge. Specifically, the Enable signal turns the TEC on and off with a certain duty cycle, and the Heating/!Cooling signal tells it whether to turn on in the heating direction or the cooling direction. Enable is S1 and Heating/!Cooling is S0 on the datasheet.

The output Za connects to two signal inputs of the H-bridge such that Za=1 causes the sample block to heat. Likewise, Zb=1 causes the sample block to cool.

ACCOMPLISHED: Forced cooling using multiplexer, H-bridge, and modified VI. Had to use second regulated power supply instead of DiabloTek computer power supply -- large currents were causing the H-bridge to heat up to the point where its over-temperature protection kicked in. Putting 3A through it, from the regulated power supply, gave satisfactory results. However, could not increase switching speed because the regulated power supply has a relay inside it that cannot switch very fast.

ACCOMPLISHED: The DiabloTek boxes supply large currents ~6A. Put two TECs in series (both electronically and thermally). This cuts down the current to a more manageable level, and also reduces the temperature gradient across each individual TEC, which is good because it puts them in a more efficient regime. Doing this, I got the sample block up to 83.8C using the DiabloTek power supply, without heating up the H-bridge unduly. (Still using a square wave with a 1s period, max duty cycle = 0.499.) Under these conditions, it seems to max out at 83.8C.

ACCOMPLISHED: fixed LabView VI so that it allowed duty cycle above 0.5, made it to 100C in a totally reasonable timeframe (est. 15min for full heating and cooling cycle).

LabView VI Part

ENABLE signal: switches on and off rapidly. When on, the TEC has voltage applied to it. When off, the TEC does nothing and discharges heat/cold to the air.

HEAT/!COOL signal: remains on the entire time it's heating, then remains off the entire time it's cooling. Controls whether the Enable signal causes the TEC to turn on in the heating direction or in the cooling direction.

Proportional control: The duty cycle of the TEC is proportional to the error between the desired and the actual heating rates (but also constrained to be between 0 and 0.5). This is how it was in the forced-heating-only VI as of Fall 2010, and I didn't change this aspect of it. To add forced cooling, I did the following:

  • Changed around the logic of the state-changes between Heating, Waiting, and Cooling.
    • IF Begin Thermal Cycle AND current temp < target temp AND (NEITHER Waiting NOR Cooling), then Heating = True.
    • IF NOT Done Waiting AND (Already Waiting OR (Heating AND current temp >= target temp)), then Waiting = True.
    • IF Begin Thermal Cycle AND (Already Cooling OR Waiting AND Done Waiting), then Cooling = True.
    • After done cooling, Cooling = False and un-press Begin Thermal Cycle button.
  • Made the controller able to deal with negative desired heating rates. Also, note that our heating control is different from a regular proportional controller in that, if the temperature is changing too slowly, you always increase the duty cycle, whether the error is positive or negative (heating or cooling). This is because of the way the information is split between the Enable and Heat/!Cool signals. Thus, when cooling, you have to negate the error. (I know, it's confusing.)
  • SCW: fixed the driver so that it actually did "duty cycle proportional to error", and didn't max out the duty cycle at 1/2. See Natl Instr help page on PWM.

The proportional control causes oscillations in the TEC duty cycle and the heating rate when you set the desired dT/dt relatively low (<0.3). To fix this, we might want to make a fancier controller. (If you set it higher, then you get thermal runaway, which is a problem with the H bridge and/or the heat sink, not the VI.)

Thermal Runaway

The H-bridge gets hot when the duty cycle is constantly high (>0.9). Why? Due to current overload? (Sometimes its over-temperature protection even kicks in.)

The little wimpy heat sink is not strong enough. Try using a better one, with a fan? Try using Kerry's old CPU cooler (remember to use cardboard to block the wind from cooling the sample block when you're on the heating part of the cycle; can remove it for the cooling part of the cycle).

Monolithic Photodiode-Amplifier

Rather than rolling our own trans-impedance amplifiers, we can use the OPT101 integrated circuit, which contains both a photodiode and a million-gain amplifier. The OPT101 is mounted on a piece of perforated board, which fits inside an optical tube.

Route the output of the photodiode-amplifier through a high-pass filter and then through an additional amplifier of gain 10, for an overall gain of 10^7.

TODO: circuit diagram

Why is the high-pass filter necessary? Remember why the LED is driven at 5kHz, and how the lock-in amplifier reduces 1/f noise? That's wonderful, but the lock-in amplifier is implemented in software. It helps to have an additional filter in hardware, before the signal reaches the DAQ. The DAQ only has one analog-to-digital converter, which is shared by all the analog input channels. It has input limits of +/- 10V. If it receives inputs outside these limits on any one channel, it will get confused and give nonsensical readings on all channels. (If you get nonsensical temperature readings, but your RTD circuit is correct, check the output of your photodiode amplifier!) A simple high-pass filter helps avoid maxing out the DAQ with amplified low-frequency noise.

(Note: the roll-your-own TI amplifier already had a high pass filter in it, but its f_c was about 100Hz. I don't see a compelling reason not to make it higher, like 4kHz, which is what I did with the OPT101.)

Disadvantages

  • You lose the experience of rolling your own high-gain amplifier. The pset made a big deal out of the TI amplifier for a reason.
  • It's much easier to fry the OPT101s by connecting their power inputs wrong. "...Oh hey, I bet that brown stuff isn't supposed to be there!"

Physically Restrained Optical System

Because people have to carry their DNA melters from place to place, the optical system tends to get misaligned very easily, leading to noisy data. Here are some ways to make the system more stable:

  • Use CL5 clamps to hold the heat sink in place on the breadboard.
  • Bend down the leads of the TEC and tie them to the 'legs' of the heat sink with short pieces of wire. (By itself this doesn't help very much, but in combination with thermal grease, it makes a big difference.)
  • Use cage rods to hold together the sample block, the photodiode, the filter, and the lenses of the fluorescence detector. To avoid conducting heat out of the sample block, add nylon standoffs to your cage rods.
  • TODO: photos
  • TODO: measure improvement in SNR with these

Translating MATLAB Into Python

I translated the Simulating DNA Melting walk-through into Python: here. TODO: test on Athena and on 309 lab computers.

I'm working on translating the "Estimate DNA Melting Parameters" analysis code into Python. It is reallllllllllllllllllllllly slow. Also, on my laptop, you can't do that animation-y thing without bringing in the big guns (GTK et al). TODO: finish last bit of code. TODO: see if fitting can be sped up. TODO: see if animation will work on Athena or 309 lab computers.

Stuff it would be nice to do in the future

Effect of Non-Uniform Sample Temperature

Run a really slow melting curve to minimize the difference between sample temperature and block temperature. See if this gets rid of that annoying sine-wave-looking component of the residuals. In order to run for a long time without photobleaching the sample to hell and back, this will require modifying the VI to take "snapshots" rather than exciting continuously.

SYBR Green Thermal Quenching Model

It would be nice to have a better model for the thermal quenching of SYBR Green than "It's linear, maybe, ish".