Skip to content

Mainboard

Published: at 12:39 AM (6 min read)

Table of Contents

Open Table of Contents

Description

The STM mainboard serves as the central control and signal-processing hub for all active subsystems. It interfaces with the scanning, positioning, and signal acquisition circuitry and enables the feedback control that makes atomic-resolution imaging possible. The design is centered around a Teensy 4.0 microcontroller, selected for its low-latency digital control capabilities.

mroot

Digital-to-Analog and Analog-to-Digital Conversion

Precision in STM scanning requires fine control over the tip position and high-resolution measurement of tunneling current. To this end, the Teensy interfaces over a Serial Peripheral Interface (SPI) bus with:

The DAC outputs are updated in real time to synthesize raster scanning voltages or apply dynamic feedback corrections to maintain a constant tunneling current IsetI_{\text{set}}. Given the exponential dependence I(d)exp(2κd)I(d) \propto \exp(-2\kappa d), even nanovolt-level changes in VzV_z (which controls dd) can modulate the tunneling current measurably. ADC (above) and DAC (below):

madc mdac

Sigma—Delta Modulation for DAC Output

Precise control of tip voltage is critical in STM operation due to the exponential dependence of tunneling current on tip–sample separation. While our mainboard uses a discrete DAC for analog control, the Teensy microcontroller also supports digital waveform synthesis via \emph{sigma—delta} (ΣΔ\Sigma\Delta) modulation, which we use for generating high-resolution bias voltages when hardware DAC channels are limited or when auxiliary analog outputs are needed.

Theory of Operation

ΣΔ\Sigma\Delta modulation is a form of oversampled digital-to-analog conversion that achieves high effective resolution by shaping quantization noise out of the signal band. A basic first-order ΣΔ\Sigma\Delta modulator consists of an integrator, a quantizer (e.g., 1-bit), and a feedback loop:

y[n]=sign(v[n]),v[n+1]=v[n]+x[n]y[n],\begin{aligned} y[n] &= \text{sign}(v[n]), \\ v[n+1] &= v[n] + x[n] - y[n], \end{aligned}

where x[n]x[n] is the input signal (scaled to [0,1]), y[n]{0,1}y[n] \in \{0,1\} is the 1-bit output, and v[n]v[n] is the internal integrator state. This results in an average output y\overline{y} that closely tracks the input xx over time. When filtered with a low-pass analog filter (e.g., an RC or op-amp integrator), the pulse-density modulated (PDM) signal y[n]y[n] reconstructs the desired analog voltage:

Vout(t)1TtTty(τ)dτx[n],V_{\text{out}}(t) \approx \frac{1}{T}\int_{t-T}^{t} y(\tau) \,d\tau \approx x[n],

for a sufficiently small TT and oversampling ratio.

Implementation on Teensy

On the Teensy 4.0, we implemented 1-bit ΣΔ\Sigma\Delta modulation using a high-frequency PWM output (at 100–500~kHz) with a software-based accumulator:

acc  +=  target_value;PWM_bit=accN.{acc} \;+=\; {target\_value}; \qquad {PWM\_bit} = {acc} \gg N.

This emulates the behavior of a 1st-order ΣΔ\Sigma\Delta loop where {target_value} is a 16- or 24-bit fixed-point number and NN controls the resolution of the quantization threshold. The output is passed through a single-pole RC low-pass filter (e.g., R=10 kΩR=10~\text{k}\Omega, C=0.1 μC=0.1~\muF) to yield an analog voltage:

VoutVlogicRonRon+Ry[n].V_{\text{out}} \approx V_{\text{logic}} \cdot \frac{R_{\text{on}}}{R_{\text{on}} + R} \cdot \overline{y[n]}.

mteensy

Application of ΣΔ\Sigma\Delta

Because the STM operates at relatively low bandwidth (scan frequencies <100<100 Hz), the high oversampling rate and narrow analog bandwidth make ΣΔ\Sigma\Delta modulation an ideal technique for generating low-noise, high-resolution voltages with minimal hardware overhead.

Advantages and Considerations

The ΣΔ\Sigma\Delta approach provides:

However, careful analog filtering is essential to suppress out-of-band noise and ensure that high-frequency switching artifacts do not couple into sensitive analog circuitry (e.g., tunneling amplifier inputs). We currently are still in the process of implementing this step!

Piezo Driver and Unimorph Excitation

The DAC outputs VxV_x, VyV_y, and VzV_z are routed to a custom piezo driver circuit that transforms these axis voltages into the composite combinations needed for the quadrant-driven unimorph disk piezo scanner. Specifically, we generate:

V1=Vz+Vx,V2=VzVx,V3=Vz+Vy,V4=VzVy,\begin{aligned} V_1 &= V_z + V_x, \\ V_2 &= V_z - V_x, \\ V_3 &= V_z + V_y, \\ V_4 &= V_z - V_y, \end{aligned}

where V1V_1 to V4V_4 are the drive voltages applied to the four quadrants of the unimorph actuator. These combinations produce orthogonal in-plane and out-of-plane displacements, enabling full three-axis nanoscale control of the tip position.

mpdriver

Coarse Positioning and Stepper Control

For coarse approach, the mainboard includes three A4988 stepper motor drivers, each controlling a 28BYJ-48 geared stepper motor driving a 1/41/4–80 fine-pitch screw. These motors are configured for microstepping, offering up to 2048 discrete steps per rotation. With a linear travel of 250~μ\mum/rev, the theoretical vertical step resolution is:

Δz=250 μm2048×206 nm/step.\Delta z = \frac{250~\mu\text{m}}{2048 \times 20} \approx 6~\text{nm/step}.

The Teensy generates direction and step pulses using its hardware timers, allowing precise synchronized control of all three coarse axes. By driving all three screws in phase, the entire scan head can be raised or lowered while maintaining parallelism with the sample surface.

msdriver

Signal Integrity and Power Regulation

To preserve signal fidelity in a high-impedance, low-noise environment, the mainboard implements:

Feedback Architecture and Thermal Monitoring

Real-time feedback control is implemented in firmware. The goal is to maintain the tunneling current I(t)I(t) at a setpoint IsetI_{\text{set}} by modulating Vz(t)V_z(t). This is achieved using a proportional-integral (PI) controller:

Vz(t)=KP(IsetI(t))+KI0t(IsetI(τ))dτ.V_z(t) = K_P \big(I_{\text{set}} - I(t)\big) + K_I \int_0^t \big(I_{\text{set}} - I(\tau)\big) \, d\tau.

This control signal is updated at fixed time intervals via Teensy hardware timers, ensuring deterministic timing critical for loop stability. The feedback bandwidth is designed to be below the mechanical resonance of the piezo stack to avoid excitation.

To support robust operation, the mainboard monitors its temperature using an LM75C digital sensor over an I2^2C bus. The Teensy reads this temperature and adjusts the onboard cooling fan PWM accordingly. This thermal feedback loop can be described as:

Fan PWM Duty=α(TT0),T>T0,\text{Fan PWM Duty} = \alpha (T - T_0), \quad T > T_0,

where α\alpha is a proportional gain and T0T_0 is the nominal threshold temperature.