Tip position True surface h(x) Tip trace z(x)

STM Feedback-Loop Line Scan (2D)

A scanning tunneling microscope images by feel, not by touch: a PI feedback loop reads the tunneling current from I ∝ V·exp(-2κd) and continuously re-adjusts the tip's height so that current stays locked to a setpoint, one raster line at a time. This 2D companion sim strips the process down to the two plots that actually matter — a live top-down topographic image building up pixel by pixel, and a real-time line-scan chart of the true surface profile against the controller's tip-height trace and its current, error and gain. Push the feedback gain up and watch the controller start to overshoot and ring across the step edge and the adsorbed-atom bump, the same tuning trade-off every real STM sits between imaging speed and topographic accuracy.