getref script will use the current position of the stage as the basis for its reference image. It will also do its best to center the image by taking multiple low-quality images and running a center-of-gravity (COG) algorithm on each one before taking the final image.
The COG algorithm is somewhat picky about the shapes it works well on. The best inputs to the COG will be:
getref script has several command line options; running it with no arguments will give a brief explanation of those options, but they are covered here in more detail.
The simplest getref command line will look like this:
getref 100 20
Where the first number (100) is the width of the search area in microns, and the second number (20) is the width of the mark in microns. This command will snap a 100-μm-wide image centered on the current stage position, try to center it on a 20-μm-wide shape, and save the final high-quality image as
reference.img in your
There are lots of optional things you can add to the command line to make it behave differently, as summarized below:
|Save the image with a custom filename. Useful if you want to keep several different reference images around for different marks/samples. No extension is needed on the filename.
|Change the pixel-integration number (and, indirectly, the image quality) of the final reference image. The system will perform 2n integrations per pixel, where n is the argument here. Default is n=8. More integrations will give a better image, but can be very time-consuming.
|Change the number of passes in the COG-based centering operation. More passes can improve the centering, particularly when the mark is a shape the COG has problems with. Default is 3.
|Bypass the COG algorithm and center the mark interactively in CSEM (like the normal JOY routine). Can be useful if the COG absolutely can’t center your mark.
|Specify a negative-tone mark. The COG algorithm doesn’t work on negative marks, so we have to reverse the image in order to center it (if you’re doing manual centering, you can leave this off)
getref 100 20 -q 9 -p 7 -f GaAs?
Here we’ve set the integration to 512 (29), the number of COG passes to 7, and the output filename to
GaAs.img The first two arguments always have to be the search area and the shape width, but everything else can be in any order you want.
ij& at a prompt. Once in the program, go into the “file” menu and select “import” and “raw.” Put in the height/width of your image in pixels (this should have been printed when the getref routine finished) and check “Little-endian byte order”, then hit OK. Your image should now be displayed, allowing you to get a rough idea of how close to centered it is. If the image looks noisy or off-centered, try re-running
getref with different parameters.
Try to make your search area big enough to include some space around your mark; correlations with other marks will fail if the mark you’re trying to align to falls partway outside the search area. A width of at least 2-3x your mark width is a good rule of thumb.
The COG algorithm does much better when the mark is already close to centered. Use CSEM to center the mark at a high magnification before running
getref if the centering isn’t working. Additionally, the COG will usually fail completely if the mark isn’t completely captured somewhere in the search area, or if other structures besides the mark are present in the search area. Adjust your search area width appropriately.
Remember, this alignment technique is only as good as the reference image! Take some time and experiment with the settings in order to get the most centered, noise-free image possible.
image_on [filename] (no extension needed). If you're using a custom reference image filename provide it here; otherwise just leave out the filename argument. Once that’s done, you can execute the job per usual. The
imgalign script will be called every time the system tries to align to a ‘joy’ mark now.
You don’t have to specify the mark size or search area size because the script will pull that information out of the text file that was generated when you took the reference image. If you keep getting mark-failure errors and seeing warnings like “poor correlation,” it’s possible that the image-capture of the alignment marks is too noisy and degrading correlation accuracy. You can increase the pixel-integration number in the alignment scans by editing the
ALIGN_PIXEL_INTEGRATION variable (the default is n=6, or 64 integrations per pixel) according to the same rules as the
-q parameter in
getref. Likewise, you can vary the image-threshold value from its default of 0.7 to any value between 0 and 1 by editing the
IMAGE_THRESHOLD variable. To edit an environment variable, use the export command:
Keep in mind that every increase in the integration will increase the mark-scan time by a factor of two, which can seriously increase your write time since the system does a full scan for every single alignment mark in your layout. Likewise, messing with the threshold is generally not recommended unless you know what you’re doing; a low threshold can give false-positive mark locations and a high one can cancel out the alignment mark along with image noise. If you have to change it, try to stick to values between 0.6 and 0.8.
When the write is finished, use
image_off (or simply close the terminal window) to revert the joy mark to its standard behavior. Note that the variable set with
image_on won’t be visible outside the terminal window that you set it in, so you’ll want to execute your job file from the same window.
ALIGN_PIXEL_INTEGRATION variable can sometimes help.
PG_IMAGES_THRESHOLD to any numeric value you want. Lower values will be less likely to error out of a successful mark location due to bad correlation, but more likely to find false-positive marks. If you’re getting lots of
%ECC_E_IMG_BADCORR errors, try lowering the threshold. Thresholds less than 1 are not recommended, as almost any two unrelated images can give you a 1% correlation threshold.
findmark joy command before you start the write. If it successfully finds the mark, use the stage position afterward as that mark’s position in the job command line. This will let you troubleshoot any location problems without having to restart your write multiple times.
ALIGN_THRESHOLD value slightly (default is 0.7). You can check for false positives by driving to an area without a mark in it and doing a
findmark joy; if it doesn’t give you an error, something is wrong.
PG_USER_JOYMARKER variable to point to an executable script, however, will cause the Vistec software to run that script whenever a ‘joy’ definition is encountered in a job file. The only purpose of
image_off is to set and unset
PG_USER_JOYMARKER, respectively. In this implementation,
PG_USER_JOYMARKER is set to
/home/pg/scripts/imgalign, with an optional reference-image argument. If you’d like to experiment with your own image-alignment algorithm, just save the script in your environment’s
/scripts directory, make sure it’s executable, and set
PG_USER_JOYMARKER to its full path before writing. Feel free to copy
imgalign to your own directory to use as a template. Scripts can be written in any language that can be executed from a linux shell; there’s probably a much better implementation than this one if you’re good with Perl or Python or something.