5 Z_byG

Example 5. Z_byG


MacroName Z_byG
##############################
# Z_byG.txt
# Updated @ 2014-10-21 12:22:49 
##############################
#
# a macro to adjust the eccentric center using beam tilted pairs.
# It uses Autofocus to measure the focus and adjust Z instead.
#

Echo ===> Running Z_byG ...

# If in Low Dose, the area should be at Focus first
# before defocus is zeroed, because it could come from V with 
# large defocus offset. It could float up in that case. 

SuppressReports
ReportLowDose
# if in LowDose and area is V
If $reportedValue1 == 1 AND $reportedValue2 == 0
  GoToLowDoseArea F
Endif 

#==================
# set objective lens 
#==================
SetEucentricFocus
#NormalizeLenses 2
#Delay 1

#===========
# Adjust Z
#===========
Loop 2
Autofocus -1
ReportAutofocus 
t = -1 * $reportedValue1
MoveStage 0 0 $t
echo --> Z moved $reportedValue1 micron 
EndLoop

#=== end ====

This macro is to adjust specimen height to eucentricity by using tilting beam method.

Normally, we use SerialEM's built-in function Eucentric Rough and Eucentric Fine for this task. These built-in functions cross-correlate image pairs from symetric stage tilts. As long as correlation works fine, the functions work reliably and give very accurate results. It also outputs the lateral displacement for this specific stage and holder. They are indeed very good.

However, this procedure takes significant mount of time because it takes quite a few images at various tilting angles. After tilting to an angle, it needs to wait some time for the stage to settle before a stable image can be taken. The stage tilting most likely generates bubbling for the already quiet LN2 in a sided-entry cryo holder like Gatan's 626. The fact is when objective lens is at Eucentric Focus, for specimen at eucentricity, the image pair from the beam tilting will overlap. Therefore, if we put objective at calibrated Eucentric Focus, and we can measure the defocus and adjust specimen Z height. This is opposite to how we do Autofocus.

The macro command SetEucentricFocus in the macro above is to recall the calibrated value and set objective lens to Eucentric Focus accordingly. The defocus is measured using Autofocus routine. But we ask it to only measure the defocus, not to change actual defocus. This is accomplished by the argument "-1" in the line


Autofocus -1

The measured defocus value is applied to stage move, in opposite direction. Again, due to intrinsic error of stage movement, we have to iterate to get it accurate enough. Here, we loop twice.

Normalizing objective lens is also for accuracy purpose, as one can see.

If the calibration is good, running this macro at a magnification will bring stage to Eucentricity, fairly accurate.