top bar

Difference between revisions of "PgFocus"

(Thanks)
m (= Linux udev Rule)
 
(46 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Description ==
 
  
pgFocus is an open source and open hardware focus stabilization device developed by Karl Bellvé at the [http://big.umassmed.edu Biomedical Imaging Group] ([http://www.umassmed.edu/pmm/index.aspx Progam in Molecular Medicine], [http://www.umassmed.edu/ University of Massachusetts Medical School]).
+
= Complete description can be found at [http://big.umassmed.edu/wiki/index.php/PgFocus BIG] =
  
The pg in pgFocus is short for "Pretty Good". pgFocus isn't "Perfect", or "Definite" but it is pretty good! (inside the industry joke)
+
== Discussion ==
  
pgFocus monitors focus changes through the positional changes of a reflected laser beam. A significant feature of pgFocus is it acts as a "man-in-the-middle." It is designed to pass through faster high fidelity signals meant for a piezo Z controller while adding a slower focus control signal. This happens in the analog realm, which avoids sampling artifacts introduced by digitizing the original signal. This design also reduces the cost of pgFocus.
+
All discussions and questions should be sent to the pgFocus mailing list  [mailto:pgfocus@googlegroups.com here].
  
== Hardware ==
+
You can also visit the web [http://groups.google.com/d/forum/pgfocus?hl=en pgFocus Google Group] interface.
  
[[File:Focus_PCB_small.jpg|frame|Figure: pgFocus PCB]]
+
== Purchasing ==
pgFocus uses the same [http://www.atmel.com/devices/ATMEGA32U4.aspx Atmel ATMEGA 32U4] as seen in the [http://arduino.cc/en/Main/arduinoBoardLeonardo Arduino Leonardo].
+
  
pgFocus is connected to a computer via a USB port. USB is used to power and to communicate with pgFocus.
+
If you are unable to build pgFocus yourself, you are welcome to contact Karl Bellve for a pgFocus. He will build it, test it, and ship it to you. Currently, he is asking for a donation to offset the cost of the electronics and a loss of a vacation day that he uses to build it. The donation also supports advancing pgFocus.
  
==== Power ====
+
== Description ==
  
pgFocus uses the USB +5V power to generate +10V and -5V power. The actual output voltage for +10V power line is lower due to the forward voltage drop of the diodes required for the boost converter IC. Just be aware that voltage signals near +10V sent through pgFocus may be reduced.
+
pgFocus is an open source and open hardware, for noncommercial use, focus stabilization device developed by Karl Bellvé at the [http://big.umassmed.edu Biomedical Imaging Group] ([http://www.umassmed.edu/pmm/index.aspx Progam in Molecular Medicine], [http://www.umassmed.edu/ University of Massachusetts Medical School]).
  
The -5V is higher (more positive) because of the same reason. Our piezo Z controller accepts -2V to +10V, so this isn't a significant issue on the -5V power line.
+
The pg in pgFocus is short for "Pretty Good". pgFocus isn't "Perfect", or "Definite" but it is pretty good!
  
==== Digital to Analog Converter ====
+
pgFocus monitors focus changes through the positional changes of a reflected laser beam. A significant feature of pgFocus is it acts as a "man-in-the-middle." It is designed to pass through faster high fidelity signals meant for a piezo Z controller while adding a slower focus control signal. This happens in the analog realm, which avoids sampling artifacts introduced by digitizing the original signal. This design also reduces the cost of pgFocus.
 
+
pgFocus uses a ±5V 14bit DAC to modify incoming piezo Z signal. This is the upper and lower voltage limit that can be used to adjust the piezo Z signal. The DAC has a resolution of 0.6 mV. Based on our piezo Z controller (10µM/Volt), this works out to a minimum 6 nM step size at the objective.
+
 
+
==== Analog to Digital Converter ====
+
 
+
pgFocus uses a ±10V 14bit ADC to sample the incoming piezo Z signal. This is to allow pgFocus to automatically adjust the focus set point, without user intervention. This feature enables pgFocus to have automated 3D focus correction.
+
 
+
The incoming piezo signal is sampled and multiplied by 2. This effectively makes the ±10V ADC become a ±5V ADC, matching the ±5V DAC.
+
 
+
This means that the lower limit for sampling the incoming piezo Z signal is actually -2.5V. -2.5V becomes -5V at the ADC, due to the gain of 2 and the limit of -5V of the power supply. Our piezo Z controller's range is from -2V to 10V. Therefore the effective ADC sampling range is actually -2.5V to +5V.
+
 
+
When pgFocus samples the incoming piezo Z signal, it rounds off the results to the nearest 50nM step since most people move their objectives at 50, 100 or 250nm increments. This allows the adjustment of the focus set point to be more accurately predicted because it is based on the distance from the original focus set point rather than just a new offset.
+
 
+
==== Linear Light Array====
+
 
+
The Linear Light Array represents a physical limit. The return beam must fall within its 128 pixels. The length of the 128 pixels is about 8mm. In our setup, the 8mm length of the Linear Light Array is equivalent to about 25 to 30µM range with a 60X objective. Longer Linear Light Arrays maybe used in future versions of pgFocus.
+
 
+
The Linear Light Array's location on the PCB is in the exact vertical center of the board. This allows you to put pgFocus in either vertical orientation and still use the same case.
+
 
+
==== Digital Expansion Port ====
+
 
+
pgFocus makes accessible 8 digital I/O pins compatible with D0 to D7 pins on the Arduino Leonardo. These pins can be used for other light sensors, or perhaps a hardware switch to turn on/off focus, or to move the focus set point up or down.
+
 
+
+5V and ground lines are also made available. However, since USB is powering pgFocus, power maybe limited. Future versions of pgFocus might have a 5V DC jack if power is a limitation in the current design.
+
 
+
==== Optics ====
+
 
+
pgFocus uses a laser beam that is reflected off the cover glass/water interface to monitor the microscope focus. Hence, an objective with an NA of at least 1.45 is required.
+
The laser beam wavelength should be different from that being used for science (808nm is a good choice) and must be coaligned with the TIRF beam. This can be done using a mirror, beam splitter and a short pass filter. Care must be taken to ensure that the fluorescence filter cube and other microscope optics will allow the return of the pgFocus beam back along its input path and back to the pgFocus detector and that the microscope optics will NOT allow the laser light to pass into the user's eyes or to reach the camera. Once the position and angle of the pgFocus beam is coincident with that of the TIRF beam a strong return pgFocus beam will be seen that moves with changes in microscope focus. The pgFocus detector array can now be aligned and centered on the beam.
+
 
+
 
+
Eagle files are located at [https://github.com/kbellve/pgFocus Github].
+
----
+
'''Warning:''' PCB design has not been verified yet and may not be final.
+
----
+
 
+
== Software ==
+
 
+
After the Arduino Leonardo was released, pgFocus was redesigned to take advantage of the bootloader and pin layout for the Arduino Leonardo. If you can write an Arduino sketch, you can modify the source code to pgFocus!
+
 
+
pgFocus software reports the following:
+
* Light profile as seen by the Linear Light Array.
+
** Use this to align the physical position of pgFocus with respect to the return laser beam.
+
* Current centroid location of the light profile as seen by the Linear Light Array.
+
* Microscope stability based on the running Standard Deviation(converted to nM movement at the objective).
+
* Digital to Analog converter voltage output need to maintain current focus position.
+
* Calibration mode result.
+
 
+
pgFocus software can do the following:
+
* Lock focus at the current position.
+
* Move focus up by a specified amount (currently set to +50nM).
+
* Move focus down by a specified amount (currently set to -50nM).
+
 
+
pgFocus software has not be released yet since it was designed for the prototype version of pgFocus rather than this version. It will be released as soon as possible.
+
 
+
==== Linear Light Array Profile ====
+
 
+
pgFocus will show a continually updating profile of the return laser beam. The return laser beam needs to be centered vertically and horizontally on the Linear Light Array. This alignment needs to be performed while the microscope is in its normal mode of operation. If the microscope is heated in an environmental chamber, then it needs to be heated before this alignment should be performed.
+
 
+
[[File:Pgfocus_lla.jpg‎|frame|Figure: Return Laser beam profile]]
+
 
+
A centroid calculation is performed on the Linear Light Array profile to get focus location. This calculation will only be performed by pgFocus if it detects a peak in the profile.
+
 
+
==== Calibration Mode ====
+
 
+
pgFocus needs to understand the relationship between the movement of the laser beam return signal seen on the Linear Light Array and the movement of the objective. This depends upon the location of pgFocus in relation to the objective. To determine this relationship, pgFocus has a calibration mode that moves the objective up and then down, while reading the position of the return laser beam. This information is plotted and a linear regression analysis is performed to determine the slope. The slope is the scale factor that pgFocus uses for calculations and for focus adjustments.
+
 
+
A calibration must be performed after first installing pgFocus, or if the distance between pgFocus or the objective changes (i.e. pgFocus is moved).
+
 
+
The user just needs to make sure the the return laser beam is aligned and centered on the Linear Light Array. pgFocus will take care of the rest and will store the resulting calculation in its EPROM.
+
 
+
The figure below is captured from the first prototype of pgFocus after it has performed its calibration routine. Notice that pgFocus will not move the objective so that it causes the return laser beam to move past the boundaries of the Linear Light Array.
+
 
+
[[File:PgFocus_calibration.jpg|frame|Figure: Calibration Output]]
+
 
+
The above figure shows two numbers for each position. The first number is Voltage DAU which ranges from 0 to 4095 (12bit DAC used on the prototype pgFocus, 0 DAU = -1.65V, 2048 DAU = 0V, 4095 DAU = +1.65V). The second number is the pixel position on the Linear Light Array, which ranges from 0 to 127. Because pgFocus calculates a centroid of the return beam light profile, it can determine sub pixel positions on the Linear Light Array.
+
 
+
pgFocus also outputs the calibration information to the USB port:
+
 
+
* INFO: DAU Per Pixel: 20.30 DAU
+
* INFO: Focus Adjust: 0.3057 pixels
+
* INFO: Calibration Activated
+
* INFO: Calibrating sensor
+
* CAL: 2648 32.4590568542
+
* CAL: 2448 41.6186561584
+
* CAL: 2248 50.1614685058
+
* CAL: 2048 59.6866722106
+
* CAL: 1848 70.1109924316
+
* CAL: 1648 80.5381393432
+
* CAL: 1448 91.6457748413
+
* SLOPE: -0.0493
+
* INTERCEPT: 3283.83
+
* DAU: 20.30
+
* INFO: 0.16 uM
+
* RESIDUALS: 0.998403
+
* INFO: Focus Adjust: 0.3057 pixels
+
* INFO: Writing calibration values to eeprom
+
* INFO: Returning objective to default position
+
  
== Performance ==
+
=== Installation ===
  
pgFocus is designed to track and control focus within ±3nM at 30Hz under optimal conditions (tested with a high NA 60X Objective plus 1.6X optivar). This is dependent upon the location of pgFocus with respect to the objective.  
+
pgFocus supports automatic device detection with firmware 0.8
  
* Precision is proportional to the distance pgFocus is from the objective.
+
Serial Settings
* Range is inversely proportional to the distance pgFocus is from the objective
+
* 57600 BAUD
 +
* Handshaking off
 +
* Parity None
 +
* Stop Bits 1
  
This [[Media:pgFocus.mov|Movie]] shows pgFocus in action. 200nM beads were TIRF imaged with uManager's burst mode with a 60X objective with a 1.6X optivar.
+
=== Linux udev Rule ===
 +
As root, create a file named /etc/udev/rules.d/99-pgFocus.rules with the following content:
 +
<blockquote># pgFocus by the Biomedical Imaging Group
 +
SUBSYSTEMS=="usb", ATTRS{product}=="Arduino Leonardo", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="8036", MODE="0660",GROUP="users",SYMLINK+="ttyACM%n"</blockquote>
  
The microscope is enclosed in an environmental chamber. The doors to the chamber were opened after image 300 and closed after image 600. You will see a disturbance to the focus at both times, but focus is soon corrected within moments. The focus is disturbed due to the change in the temperature gradient across the microscope caused by the open doors.
+
== pgFocus Plugin ==
  
Below is the graph of pgFocus performance from the above movie.
+
=== Real Time Panel ===
  
[[File:pgFocus_graph.png|frame|Figure: pgFocus in action. Doors to a microscope environmental chamber were opened after image 300 and then closed after image 600.]]
+
The pgFocus plugin graphs incoming data from the pgFocus hardware.
  
 +
[[Image:pgFocus_Realtime.png|center|500px]]
  
As you can see in the above graph, even after the doors were closed, a constant voltage adjustment had to be applied to keep focus at its original position.
+
Top graph shows the current focus offset.
  
Below is a graph of what happens when pgFocus isn't stabilizing focus during the same procedure.
+
Second from top graph is the Standard Deviation of the offset over time, in nM.
  
[[File:pgFocus_off.png|frame|Figure: pgFocus has been turned off, but the doors were opened and closed. Only plotting the Linear Light Array since no voltage is being applied to correct focus. ]]
+
The second from the bottom graph shows the voltage output, in nM, of the on-board Digital to Analog Converter.  
  
As you can see in the bottom graph, focus position has changed even after the doors were closed due to the perturbations introduced into the microscope. The focus position may eventually correct itself once the temperature gradient returns to its original gradient.
+
The bottom graph shows the voltage input, in nM, as measured by the on board Analog to Digital Converter.
  
These are severe perturbations but pgFocus is very good at automatically compensating for slow focal drift over time.
+
The update frequency can be changed in the settings panel.
  
== Parts ==
+
=== Light Profile Panel ===
  
Preliminary parts list. Parts may change at any time.
+
The light profile graph can be used to center the reflected laser beam onto pgFocus' sensor.
  
{|border="1"  style="text-align:center;"
+
[[Image:pgFovus_Lightprofile.png|center|500px]]
|-
+
!Name
+
!Current
+
!Voltage
+
!Reference
+
!Notes
+
|-
+
|TSL1401CL
+
|5mA
+
|5V
+
|[http://www.mouser.com/ProductDetail/ams/TSL1401CL/?qs=%2fha2pyFadui9qowM2EAvhG%2fJktwzmI3oPG4s%2fwQmRk8%3d Mouser] [http://octopart.com/tsl1401cl-taos-22060121 Octopart]
+
|0.018 to 100ms Exposure Time
+
|-
+
|ATMEGA32U4
+
|7mA
+
|5V
+
|[http://www.atmel.com/devices/atmega32u4.aspx ATMEL] [http://www.newark.com/jsp/search/productdetail.jsp?sku=26R5633 Newark]
+
|
+
|-
+
|AD8221ARZ
+
|1mA
+
| -12V to 12V
+
|[http://www.analog.com/en/specialty-amplifiers/instrumentation-amplifiers/ad8221/products/product.html Analog Devices] [http://www.analog.com/static/imported-files/data_sheets/AD8221.pdf PDF]
+
|
+
|-
+
|AD5531BRUZ
+
|2mA
+
| -12V to 12V
+
|[http://www.analog.com/en/digital-to-analog-converters/da-converters/ad5531/products/product.html Analog Devices]  [http://www.analog.com/static/imported-files/data_sheets/AD5530_5531.pdf PDF]
+
|
+
|-
+
|TC7660
+
|20mA
+
|5V to 10V, -5V
+
|[http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010576 Microchip] [http://ww1.microchip.com/downloads/en/DeviceDoc/21465b.pdf PDF]  [http://www.newark.com/microchip/tc7660coa/ic-charge-pump-dc-dc-converter/dp/61K3539 Newark]
+
|10kHz. Use 10uF caps
+
|-
+
|TC7660H
+
|
+
|5V to 10V, -5V
+
|[http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010577 Microchip]  [http://ww1.microchip.com/downloads/en/DeviceDoc/21466a.pdf PDF] [http://www.newark.com/microchip/tc7660coa/ic-charge-pump-dc-dc-converter/dp/61K3539 Newark] 
+
|120kHz. Use 1uF caps
+
|-
+
|AD7894-10
+
|4mA
+
| -10V to 10V
+
|[http://www.analog.com/en/analog-to-digital-converters/ad-converters/ad7894/products/product.html Analog Devices]  [http://www.analog.com/static/imported-files/data_sheets/AD7894.pdf PDF]  [http://www.newark.com/analog-devices/ad7894arz-3/serial-14-bit-adc-i-c/dp/59K5904?in_merch=Popular%20Products Newark]
+
|Serial (not SPI or I2C), Using GAIN on 2 with op amp for -5 to +5V range
+
|-
+
|ADR03BRZ
+
|1mA
+
|2.5V reference
+
|[http://www.analog.com/en/special-linear-functions/voltage-references/adr03/products/product.html Analog Devices] [http://www.analog.com/static/imported-files/data_sheets/ADR01_02_03_06.pdf PDF][http://www.newark.com/analog-devices/adr03brz/ic-series-v-ref-2-5v-2-5mv-8-soic/dp/59K2682?in_merch=Popular%20Products Newark]
+
|2.5V Reference
+
|-
+
|ADTL082
+
|1.2mA
+
|
+
|[http://www.analog.com/en/all-operational-amplifiers-op-amps/operational-amplifiers-op-amps/adtl082/products/product.html Analog Devices] [http://www.analog.com/static/imported-files/data_sheets/ADTL082_084.pdf PDF]
+
|Unity Gain Stable
+
|-
+
|RJ45-8PTH
+
|NA
+
|NA
+
|
+
|
+
|-
+
|USB Type B
+
|NA
+
|NA
+
|[http://www.newark.com/jsp/search/productdetail.jsp?sku=14N8154 Newark]
+
|
+
|-
+
| PTC Resettable Fuse
+
|500mA
+
|15V
+
|[http://www.newark.com/jsp/search/productdetail.jsp?sku=02J2730 Newark]
+
|
+
|-
+
|Schottky Diode
+
|30mA
+
|30V
+
|[http://search.digikey.com/us/en/products/RB751G-40T2R/RB751G-40T2RDKR-ND/1801055 Digi-key]
+
|2-SMD, Flat Lead
+
|-
+
|Schottky Diode
+
|200mA
+
|40V
+
|[http://www.newark.com/jsp/search/productdetail.jsp?sku=75R5257 Newark]
+
|SOD-323
+
|-
+
|18pF Capacitor
+
|
+
|50V
+
|[http://www.newark.com/jsp/search/productdetail.jsp?sku=06R5140 Newark]
+
|0603
+
|-
+
|100pF Capacitor
+
|
+
|50V
+
|[http://www.newark.com/jsp/search/productdetail.jsp?sku=06R5119 Newark]
+
|0603
+
|-
+
|1000pF Capacitor
+
|
+
|50V
+
|[http://www.newark.com/jsp/search/productdetail.jsp?sku=06R4910 Newark]
+
|0603
+
|-
+
|0.01uF Capacitor
+
|
+
|50V
+
|[http://www.newark.com/jsp/search/productdetail.jsp?sku=06R4918 Newark]
+
|0603
+
|-
+
|0.1uF Capacitor
+
|
+
|50V
+
|[http://www.newark.com/jsp/search/productdetail.jsp?sku=06R4927 Newark]
+
|0603
+
|-
+
|10uF Capacitor
+
|
+
|16V
+
|[http://www.newark.com/jsp/search/productdetail.jsp?sku=59M9559 Newark]
+
|1206, ESR: 0.2ohm
+
|-
+
|10uF Capacitor
+
|
+
|16V
+
|[http://www.newark.com/jsp/search/productdetail.jsp?sku=09K5840 Newark] [http://www.avx.com/docs/Catalogs/tcj.pdf PDF]
+
|1206, ESR: 3ohm
+
|-
+
|Enclosure
+
|
+
|
+
|[http://www.hammondmfg.com/1455NC.htm Hammond] [http://www.hammondmfg.com/pdf/1455NC1201.pdf PDF]
+
|Part Number: 1455NC1201
+
|}
+
  
 +
The refresh rate can be adjusted in the settings panel.
  
== Thanks ==
+
=== Calibration Panel ===
  
pgFocus couldn't have been designed without the support from the [http://www.umassmed.edu/pmm/index.aspx Program in Molecular Medicine] at [http://www.umassmed.edu Umass], and the following Open Software and Open Hardware communities:
+
[[Image:pgFocus_Calibration.png|center|500px]]
  
*[http://valelab.ucsf.edu/~MM/MMwiki/index.php/Micro-Manager_Open_Source_Microscopy_Software uManager]
+
Calibration should be performed after setting up pgFocus, and after any changes. It lets pgFocus know how far to move the objective to maintain focus.
  
*[http://www.adafruit.com/ Adafruit industries]
+
=== Settings Panel ===
  
*[http://www.sparkfun.com/ Sparkfun Electronics]
+
[[Image:pgFocus_Settings.png|center|500px]]
  
*[http://www.parallax.com/ Parallax Inc]
+
Most of the important parameters can be changed on this panel. Additional parameters can be modified or viewed in the Device/Property Browser window for pgFocus.
  
*[http://www.arduino.cc/ Arduino]
+
=== Device/Property Browser ===
  
*[http://arduino.cc/forum/index.php?topic=19909.0 Kevin Gordon] for the TSL1401-DB code snippet
+
[[Image:pgFocus_DeviceAdapter.png|center|500px]]

Latest revision as of 13:43, 23 June 2015

Complete description can be found at BIG

Discussion

All discussions and questions should be sent to the pgFocus mailing list here.

You can also visit the web pgFocus Google Group interface.

Purchasing

If you are unable to build pgFocus yourself, you are welcome to contact Karl Bellve for a pgFocus. He will build it, test it, and ship it to you. Currently, he is asking for a donation to offset the cost of the electronics and a loss of a vacation day that he uses to build it. The donation also supports advancing pgFocus.

Description

pgFocus is an open source and open hardware, for noncommercial use, focus stabilization device developed by Karl Bellvé at the Biomedical Imaging Group (Progam in Molecular Medicine, University of Massachusetts Medical School).

The pg in pgFocus is short for "Pretty Good". pgFocus isn't "Perfect", or "Definite" but it is pretty good!

pgFocus monitors focus changes through the positional changes of a reflected laser beam. A significant feature of pgFocus is it acts as a "man-in-the-middle." It is designed to pass through faster high fidelity signals meant for a piezo Z controller while adding a slower focus control signal. This happens in the analog realm, which avoids sampling artifacts introduced by digitizing the original signal. This design also reduces the cost of pgFocus.

Installation

pgFocus supports automatic device detection with firmware 0.8

Serial Settings

  • 57600 BAUD
  • Handshaking off
  • Parity None
  • Stop Bits 1

Linux udev Rule

As root, create a file named /etc/udev/rules.d/99-pgFocus.rules with the following content:

# pgFocus by the Biomedical Imaging Group SUBSYSTEMS=="usb", ATTRS{product}=="Arduino Leonardo", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="8036", MODE="0660",GROUP="users",SYMLINK+="ttyACM%n"

pgFocus Plugin

Real Time Panel

The pgFocus plugin graphs incoming data from the pgFocus hardware.

PgFocus Realtime.png

Top graph shows the current focus offset.

Second from top graph is the Standard Deviation of the offset over time, in nM.

The second from the bottom graph shows the voltage output, in nM, of the on-board Digital to Analog Converter.

The bottom graph shows the voltage input, in nM, as measured by the on board Analog to Digital Converter.

The update frequency can be changed in the settings panel.

Light Profile Panel

The light profile graph can be used to center the reflected laser beam onto pgFocus' sensor.

PgFovus Lightprofile.png

The refresh rate can be adjusted in the settings panel.

Calibration Panel

PgFocus Calibration.png

Calibration should be performed after setting up pgFocus, and after any changes. It lets pgFocus know how far to move the objective to maintain focus.

Settings Panel

PgFocus Settings.png

Most of the important parameters can be changed on this panel. Additional parameters can be modified or viewed in the Device/Property Browser window for pgFocus.

Device/Property Browser

PgFocus DeviceAdapter.png
© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact