Difference between revisions of "DNA Melting: Using the Matlab DNAMelter GUI"

From Course Wiki
Jump to: navigation, search
(Options:)
Line 46: Line 46:
 
'CalculateTemperatureFcn' may be used to specify an external function to calculate temperature if a special temperature sensor such as an RTD is substituted for the standard thermistor.  The function takes two arguments, a struct and a voltage, and returns temperature.  The struct contains the standard thermistor parameters as well as any others specified in the command line.  The standard temperature function is equivalent to
 
'CalculateTemperatureFcn' may be used to specify an external function to calculate temperature if a special temperature sensor such as an RTD is substituted for the standard thermistor.  The function takes two arguments, a struct and a voltage, and returns temperature.  The struct contains the standard thermistor parameters as well as any others specified in the command line.  The standard temperature function is equivalent to
 
: <code> @(params,V) (params.Rpu*V/(params.Vref - V) - params.Rt0)/params.alphaT </code>
 
: <code> @(params,V) (params.Rpu*V/(params.Vref - V) - params.Rt0)/params.alphaT </code>
 +
 +
 +
----
 +
The following will be moved to its own page:
 +
 +
== Description: ==
 +
 +
The Matlab DNA Lock-In GUI is called <code>DNALockIn.m</code> and is located in the <code>CourseMaterials/Labs/DNAMelting</code>. You may make a copy in your directory of choice, double click that copy to open the code in Matlab, then run the code via the Run button.
 +
 +
DNALockIn is very similar to DNAMelter; however DNALockIn also provides for driving the LED and temperature control.
 +
 +
On the left side of the window, DNALockIn has panels for setting the LED carrier frequency and amplitude, for temperature control (min and max temperature as well as ramp times), for temperature control PID parameters, and thermistor parameters.
 +
 +
'''Carrier:'''
 +
 +
'''Temperature:'''
 +
 +
'''PID Gains:'''
 +
 +
'''Thermistor:''' It is important to set the '''Vref''' and '''Rpullup''' parameters each time DNALockIn is run, so that the temperature is computed accurately. (Remember you are attempting to determine the melting ''temperature'' of a DNA sample.) Vref is the actual voltage supplied either by the reference or +15V supply, and Rpullup is the "pull-up" resistor in the thermistor circuit. Rt0 is the thermistor resistance at 0 C (1000 ohms) and alphaT is the thermistor temperature coefficient (3.85 ohm/degree).  Rt0 and alphaT should not be changed unless a different type of thermistor is used. 
 +
 +
DNALockIn graphs the fluorescence voltage signal as well as temperature data in multiple plots.  DNALockIn acquires the temperature and fluorescence signals at 200 kHz every 0.1 seconds (20000 data points).  Select signals and their associated spectra are displayed in the two left-hand graphs.  Florescence voltage and temperature (averaged over the 20000 points every 0.1 seconds) versus time are plotted in the upper right-hand graph.  Florescence voltage versus temperature is plotted in the lower right-hand graph.
 +
 +
At the end of a run, use the "Save Data" button to save to a file. The data will be tab-delimited and can be read into Matlab with the <code>load</code> command.
 +
 +
Troubleshooting: If Matlab gives you a data acquisition error, for example, "<code>NO DATA ACQUISITION DEVICE FOUND!</code>", open the Measurement and Automation Explorer ("MAX"), open the Devices and Interfaces drop-down on the left side, and make sure there is only one "NI USB-6xxx" entry and that it is called "Dev1." If it is not, or there is more than one device listed, physically disconnect the USB cable from your DAQ, then delete all "NI USB-6xxx" entries, then reconnect your DAQ, then verify that one entry reappears and that it is called "Dev1." Try to run the DNAMelter program again, and/or close it, re-open it, and run it again. If this does not work, consult a TA or Instructor.
 +
 +
== Options: ==
 +
 +
DNALockIn may be run in the Matlab command window or in another script as
 +
: <code>DNALockIn</code>
 +
or with optional Matlab-style 'Name', Value pairs which can be used to pre-set parameters in the GUI
 +
: <code>DNALockIn('Name',Value,...)</code>
 +
 +
The following options may be set:
 +
{| class="wikitable"
 +
|-
 +
! Option name !! Description !! Default
 +
|-
 +
| 'rate' || Data acquisition rate || 200000 Hz
 +
|-
 +
| 'duration' || Data acquisition time || 0.1 seconds
 +
|-
 +
| 'Vref' || Thermistor reference voltage || 15 V 
 +
|-
 +
| 'Rpu' || Thermistor pullup || 15000 ohms   
 +
|-
 +
| 'Rt0' || Thermistor R at T=0 || 1000 ohms
 +
|-
 +
| 'alphaT' || Thermistor coefficient || 3.850 ohms/degree
 +
|-
 +
| 'CalculateTemperatureFcn' || User function to calculate temperature || (see below)
 +
|-
 +
| 'taskbarHeight' || Height of Windows taskbar for sizing window || 40 pixels
 +
|-
 +
| 'LEDoffV' || Drive voltage to force LED off || -0.025 V
 +
|-
 +
| 'frequency' || LED drive frequency || 8000 Hz
 +
|-
 +
| 'amplitude' || LED drive amplitude || 0.010 A
 +
|-
 +
| 'offset' || LED drive offset || 0.012 A
 +
|-
 +
| 'Rsense' || LED current scaling Rsense || 100 ohms
 +
|-
 +
| 'Tmin' || Start temperature || 25 C
 +
|-
 +
| 'Tmax' || End temperature || 95 C
 +
|-
 +
| 'tHeat' || heat ramp time || 900 seconds
 +
|-
 +
| 'tCool' || cool ramp time || 900 seconds
 +
|-
 +
| 'tHold' || hold time || 120 seconds
 +
|-
 +
| 'Pgain' || Proportional gain || 0.5
 +
|-
 +
| 'Igain' || Integral gain || 0.02
 +
|-
 +
| 'Dgain' || Derivative gain || 0.75 
 +
|-
 +
| 'Ilimit' || PID integral limit || 1 
 +
|-
 +
| 'controltime' || Temperature control update time || 1 
 +
|-
 +
| 'fan' || Set to 1 to force fan always on || 0 
 +
|-
 +
| 'fanmask' || Set to 0 to force fan always off || 1
 +
|-
 +
| 'BandPassFilterFcn' || User function to set BandPassFilter || See Filters
 +
|-
 +
| 'BandPassFilter' || Band pass filter kernel || 1
 +
|-
 +
| 'DownSampleRate' || Intermediate down sample frequency || 1000 Hz
 +
|-
 +
| 'DownSampleFilterFcn' || User function to set DownSampleFilter || See Filters
 +
|-
 +
| 'DownSampleFilter' || Down-sampling filter || See Filters
 +
|-
 +
| 'LowPassFilterFcn' || User function to set LowPassFilter || See Filters
 +
|-
 +
| 'LowPassFilter' || Low pass filter kernel || 1
 +
|}
 +
 +
Example:
 +
: <code>DNAMelter('Rpu',14860,'Vref',14.96)</code>
 +
Starts the GUI with Rpullup set to 14860 and Vref set to 14.96.
 +
 +
'CalculateTemperatureFcn' may be used to specify an external function to calculate temperature if a special temperature sensor such as an RTD is substituted for the standard thermistor.  The function takes two arguments, a struct and a voltage, and returns temperature.  The struct contains the standard thermistor parameters as well as any others specified in the command line.  The standard temperature function is equivalent to
 +
: <code> @(params,V) (params.Rpu*V/(params.Vref - V) - params.Rt0)/params.alphaT </code>
 +
 +
== Filters: ==

Revision as of 19:40, 5 August 2013

Description:

The Matlab DNA Melting GUI ("Graphical User Interface") is called DNAMelter.m and is located in the CourseMaterials/Labs/DNAMelting. You may make a copy in your directory of choice, double click that copy to open the code in Matlab, then run the code via the Run button.

On the left side of the window, DNAMelter displays the current sample block temperature. Also shown are the thermistor circuit parameters used to compute the actual temperature. Note: it is important to set the Vref and Rpullup parameters each time DNAMelter is run, so that the temperature is computed accurately. (Remember you are attempting to determine the melting temperature of a DNA sample.) Vref is the actual voltage supplied either by the reference or +15V supply, and Rpullup is the "pull-up" resistor in the thermistor circuit. Rt0 is the thermistor resistance at 0 C (1000 ohms) and alphaT is the thermistor temperature coefficient (3.85 ohm/degree). Rt0 and alphaT should not be changed unless a different type of thermistor is used.

DNAMelter graphs the fluorescence voltage signal as well as temperature data in multiple plots. DNAMelter acquires the temperature and fluorescence signals at 1000 Hz every 0.1 seconds (100 data points). The fluorescence signal and spectrum are displayed in the two left-hand graphs. Florescence voltage and temperature (averaged over the 100 points every 0.1 seconds) versus time are plotted in the upper right-hand graph. Florescence voltage versus temperature are plotted in the lower right-hand graph.

At the end of a run, use the "Save Data" button to save to a file. The data will be tab-delimited and can be read into Matlab with the load command.

Troubleshooting: If Matlab gives you a data acquisition error, for example, "NO DATA ACQUISITION DEVICE FOUND!", open the Measurement and Automation Explorer ("MAX"), open the Devices and Interfaces drop-down on the left side, and make sure there is only one "NI USB-6xxx" entry and that it is called "Dev1." If it is not, or there is more than one device listed, physically disconnect the USB cable from your DAQ, then delete all "NI USB-6xxx" entries, then reconnect your DAQ, then verify that one entry reappears and that it is called "Dev1." Try to run the DNAMelter program again, and/or close it, re-open it, and run it again. If this does not work, consult a TA or Instructor.

Options:

DNAMelter may be run in the Matlab command window or in another script as

DNAMelter

or with optional Matlab-style 'Name', Value pairs which can be used to pre-set parameters in the GUI

DNAMelter('Name',Value,...)

The following options may be set:

Option name Description
'rate' Data acquisition rate (default 1000 [Hz])
'duration' Data acquisition time (default 0.1 [seconds])
'Vref' Thermistor reference voltage (default 15 [V])
'Rpu' Thermistor pullup (default 15000 [ohms])
'Rt0' Thermistor R at T=0 (default 1000 [ohms])
'alphaT' Thermistor coefficient (default 3.850 [ohms/degree])
'CalculateTemperatureFcn' User function to calculate temperature
'taskbarHeight' Height of Windows taskbar for sizing window (default 40 [pixels])

Example:

DNAMelter('Rpu',14860,'Vref',14.96)

Starts the GUI with Rpullup set to 14860 and Vref set to 14.96.

'CalculateTemperatureFcn' may be used to specify an external function to calculate temperature if a special temperature sensor such as an RTD is substituted for the standard thermistor. The function takes two arguments, a struct and a voltage, and returns temperature. The struct contains the standard thermistor parameters as well as any others specified in the command line. The standard temperature function is equivalent to

@(params,V) (params.Rpu*V/(params.Vref - V) - params.Rt0)/params.alphaT



The following will be moved to its own page:

Description:

The Matlab DNA Lock-In GUI is called DNALockIn.m and is located in the CourseMaterials/Labs/DNAMelting. You may make a copy in your directory of choice, double click that copy to open the code in Matlab, then run the code via the Run button.

DNALockIn is very similar to DNAMelter; however DNALockIn also provides for driving the LED and temperature control.

On the left side of the window, DNALockIn has panels for setting the LED carrier frequency and amplitude, for temperature control (min and max temperature as well as ramp times), for temperature control PID parameters, and thermistor parameters.

Carrier:

Temperature:

PID Gains:

Thermistor: It is important to set the Vref and Rpullup parameters each time DNALockIn is run, so that the temperature is computed accurately. (Remember you are attempting to determine the melting temperature of a DNA sample.) Vref is the actual voltage supplied either by the reference or +15V supply, and Rpullup is the "pull-up" resistor in the thermistor circuit. Rt0 is the thermistor resistance at 0 C (1000 ohms) and alphaT is the thermistor temperature coefficient (3.85 ohm/degree). Rt0 and alphaT should not be changed unless a different type of thermistor is used.

DNALockIn graphs the fluorescence voltage signal as well as temperature data in multiple plots. DNALockIn acquires the temperature and fluorescence signals at 200 kHz every 0.1 seconds (20000 data points). Select signals and their associated spectra are displayed in the two left-hand graphs. Florescence voltage and temperature (averaged over the 20000 points every 0.1 seconds) versus time are plotted in the upper right-hand graph. Florescence voltage versus temperature is plotted in the lower right-hand graph.

At the end of a run, use the "Save Data" button to save to a file. The data will be tab-delimited and can be read into Matlab with the load command.

Troubleshooting: If Matlab gives you a data acquisition error, for example, "NO DATA ACQUISITION DEVICE FOUND!", open the Measurement and Automation Explorer ("MAX"), open the Devices and Interfaces drop-down on the left side, and make sure there is only one "NI USB-6xxx" entry and that it is called "Dev1." If it is not, or there is more than one device listed, physically disconnect the USB cable from your DAQ, then delete all "NI USB-6xxx" entries, then reconnect your DAQ, then verify that one entry reappears and that it is called "Dev1." Try to run the DNAMelter program again, and/or close it, re-open it, and run it again. If this does not work, consult a TA or Instructor.

Options:

DNALockIn may be run in the Matlab command window or in another script as

DNALockIn

or with optional Matlab-style 'Name', Value pairs which can be used to pre-set parameters in the GUI

DNALockIn('Name',Value,...)

The following options may be set:

Option name Description Default
'rate' Data acquisition rate 200000 Hz
'duration' Data acquisition time 0.1 seconds
'Vref' Thermistor reference voltage 15 V
'Rpu' Thermistor pullup 15000 ohms
'Rt0' Thermistor R at T=0 1000 ohms
'alphaT' Thermistor coefficient 3.850 ohms/degree
'CalculateTemperatureFcn' User function to calculate temperature (see below)
'taskbarHeight' Height of Windows taskbar for sizing window 40 pixels
'LEDoffV' Drive voltage to force LED off -0.025 V
'frequency' LED drive frequency 8000 Hz
'amplitude' LED drive amplitude 0.010 A
'offset' LED drive offset 0.012 A
'Rsense' LED current scaling Rsense 100 ohms
'Tmin' Start temperature 25 C
'Tmax' End temperature 95 C
'tHeat' heat ramp time 900 seconds
'tCool' cool ramp time 900 seconds
'tHold' hold time 120 seconds
'Pgain' Proportional gain 0.5
'Igain' Integral gain 0.02
'Dgain' Derivative gain 0.75
'Ilimit' PID integral limit 1
'controltime' Temperature control update time 1
'fan' Set to 1 to force fan always on 0
'fanmask' Set to 0 to force fan always off 1
'BandPassFilterFcn' User function to set BandPassFilter See Filters
'BandPassFilter' Band pass filter kernel 1
'DownSampleRate' Intermediate down sample frequency 1000 Hz
'DownSampleFilterFcn' User function to set DownSampleFilter See Filters
'DownSampleFilter' Down-sampling filter See Filters
'LowPassFilterFcn' User function to set LowPassFilter See Filters
'LowPassFilter' Low pass filter kernel 1

Example:

DNAMelter('Rpu',14860,'Vref',14.96)

Starts the GUI with Rpullup set to 14860 and Vref set to 14.96.

'CalculateTemperatureFcn' may be used to specify an external function to calculate temperature if a special temperature sensor such as an RTD is substituted for the standard thermistor. The function takes two arguments, a struct and a voltage, and returns temperature. The struct contains the standard thermistor parameters as well as any others specified in the command line. The standard temperature function is equivalent to

@(params,V) (params.Rpu*V/(params.Vref - V) - params.Rt0)/params.alphaT

Filters: