This paper presents a general real-time feedback dynamic control framework for transmission electron microscopy and scanning transmission electron microscopy, which achieves active drift compensation at picometer-level precision by directly controlling the sample stage. It can be deployed as a DigitalMicrograph plugin without any modification to the microscope hardware.
Drift correction schemes widely used in current research on scanning transmission electron microscopy and electron holography follow a core workflow: first, a series of short-exposure images is acquired, and then specially developed advanced software performs numerical image registration to counteract the effects of sample drift during imaging.
This numerical correction strategy works well overall, but has several inherent limitations: it requires acquiring and storing very large datasets, directly increasing computational cost; it reduces the effective field of view; and the processing can easily introduce additional numerical artifacts. More fundamentally, this post-hoc numerical correction approach always points to a core question that has not been adequately addressed: is it possible to continuously measure instrument instability during the experiment itself and achieve autonomous real-time compensation?
To meet the real-time compensation needs described above, the dynamic control proposed in this study is a general real-time feedback framework. Its core design concept is to continuously monitor experimental variables from the detector data stream and actively compensate for their evolution during image acquisition, thereby actively stabilizing electron microscopy experiments, and covering a variety of controllable experimental instabilities.
The framework is implemented entirely as a software plugin and requires no modification to the electron microscope's hardware. It can be deployed directly on any modern electron microscope that exposes the detector data stream and microscope control interfaces, runs in parallel with image acquisition tasks, and includes built-in automated calibration routines.
This dynamic-control-based active drift compensation scheme relies on a piezoelectric sample stage to achieve picometer-level sample stability, supporting drift-corrected atomic-resolution imaging. Stage-based active stabilization can markedly improve long-exposure imaging and in-situ experiments, increasing the effective exposure time while preserving the full field of view and maintaining consistent optical conditions, without performing numerical alignment on large datasets.
The dynamic control framework allows multiple feedback units to run simultaneously; each unit can operate independently or in synchronized cooperation, each controls a different process variable, and each has its own independent control period , enabling parallel handling of multidimensional drift. In its deployment for electron holography experiments, the framework uses two dedicated feedback units to independently compensate for sample drift and interference-fringe drift respectively, while scheduling a third unit to handle the image acquisition workflow.
To avoid resource conflicts arising from multiple feedback units concurrently accessing the microscope control interfaces and detector data stream, the framework introduces a dedicated resource-sharing scheduling mechanism: an image distributor module takes over all frames output by the detector and dispatches them directionally according to each feedback unit's task requirements, ensuring that all hardware resource accesses satisfy the non-concurrency constraint and safeguarding the stability of real-time drift compensation at the operational level. Together with the accompanying sub-diagrams, you can view the complete pipeline from a single feedback unit to three-channel parallel control and clearly understand the interaction relationships among the modules.
The study measured the minimum displacement step sizes of the piezoelectric sample stages of the three microscopes under test: the step size was 15±1 pm in the X direction and 5±1 pm in the Y direction, comparable to the performance achieved by deflector-shift-based compensation schemes. The measured angle between the two motion axes of the stage was 90±3°, demonstrating that the piezoelectric sample stage possesses excellent mechanical characteristics capable of supporting atomic-level drift compensation operations.
When the feedback unit is active, only very low residual drift is observed in the experiment: the average residual displacement over the first 90 frames is about 0.4 pixels (corresponding to 7 pm), with a standard deviation of about 1 pixel (corresponding to 17 pm); this residual displacement stems from both the precision limitations of the feedback loop and the measurement uncertainty of the post-processing image registration software. When the feedback unit is deactivated, an approximately linear sample drift is observed, developing mainly along the image X axis, with total drift reaching about 35 pixels (corresponding to 0.6 nm) before the feedback unit is reactivated. Please refer to the immediately following stacked acquisition-sequence diagram and the drift-displacement curve with segmented annotations to understand the differences in drift characteristics under different feedback states.
In addition to reducing the computational overhead and data volume during long acquisitions, the stage-motion-based sample stabilization scheme avoids introducing artifacts from numerical interpolation. When frame summation is performed in parallel with the operation of the feedback unit, the dynamic control framework can directly output a single image ready for analysis of structural distortions or changes in crystal orientation.
The dynamic control drift compensation framework has clearly defined applicability boundaries: when images must be acquired with a particular detector, the system can measure sample drift using another detector that records simultaneously and has higher contrast or lower noise, thereby supporting imaging tasks with the corresponding detector.