Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

Home | Scripts | Examples | Functions | Recent Updates | Tutorials | Resources | Publications | Consulting | Projects | Contact & Bio |PyJEM| Search

 

TEM Control
Function
Creates a control panel to control the microscope from within DigitalMicrograph. This script enables the user to control the image shift, stage shift (X, Y, Z, A, B,) focus, magnification, spot size and brightness.
Version
version:20130114, v2.0
Author
D. R. G. Mitchell.
Acknowledgements
Thanks to Christoph Gammer and Phil Ahrenkiel for assistance with 'em' series of microscope control commands.
Comments

This script is provided in good faith. It has been tested on an FEI Osiris TEM only. Use of this script is at the discretion of the user. The author accepts no responsibility for any loss or damage to equipment which might arise from its use.

Why use it? I dislike the control buttons on the FEI interface. They do not provide any tactile feedback and particularly when adjusting the z-axis, I find precise control to be difficult. In this control panel a set step size for all stage movements, shift, focus etc is used and so it is easy to change settings in small increments or to use multiple clicks to approach a target point slowly and not overshoot. All step sizes are in nm, except brightness (arbitrary units) and tilts (degrees). Use of very small steps for the stage (eg <100nm) may or may not work reliably - remember this is a mechanical system. All electronic controls: image shift, focus, brightness etc can be changed in very small increments reliably.

After a translation there will be stage-induced drift which can take a long time to settle. To address this a jiggle function has been built in to the X, Y and Z stage shifts. Simply click on any of those controls with the ALT key held down and the stage with be jiggled about that position - to help eliminate backlash.

Whenever the script is run a mini-help file is printed in the Results window, which details all of the features.

System Requirements

This script should work on any modern TEM which uses ethernet to communicate with DigitalMicrograph - such as FEI Tecnai, Osiris, JEOL 2100, 1400, 2200, ARM. It has been tested on an Osiris only, so there are no guarantees that it will work on other TEMs. It will probably not work with older TEMs which use serial communication. See the 2010F Control Palette script which was designed for such systems.

DigitalMicrograph (DM) must be able to communicate with your TEM in order for this script to work. If DM currently sources magnification, voltage and other information automatically, then communication is working. If you have to enter the magnification at each image acquisition, then communication is not working.

Known Issues
This script works well on my FEI Osiris. The control directions in the control panel map fairly closely to the directions I see on my screen. This may not be case with your system. If Up is Down and vice versa, then it is easily solved by using negative step values in the control panel. You can also edit the script - you'll see a big long list of functions such as zup (responds when the Z Up button is pressed) and from the code it should be clear what is happening. If the mapping is rotated 90 degrees, eg up is right (or left) then it is a bit more tricky to resolve. You'll need to change the mapping between the buttons and their functions so that the up button calls the left (or right) function. Have a go at editing the script yourself - if you get stuck, contact the author. This may be the case when using a GIF - but do bear in mind that in the GIF camera set up there is an option to rotate the camera (electronically - not physically) in 90 deg increments, so you can match directions between what you see on the fluorescent screen and the GIF. If the mapping is at some arbitary angle eg 45 degs, then there is not much that can be done apart from tilting you head to the required angle.
Supported
Yes, but do bear in mind I have only one TEM (Osiris) and have friends with a JEOL 2100 and an ARM. I'll try and assist with specific hardware issues, but without access it will be difficult to resolve problems.
Included Files
Script File.
Source Code

See the downloaded file.