JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Closing the Loop: Adaptive DBS, Responsive Stimulation and the Control Problem

Why always-on is wasteful, how pathological beta becomes a control signal, the on-off and proportional policies that adapt stimulation, responsive stimulation for epilepsy, and the read-write artifact problem.

The cost of always-on

Open-loop DBS stimulates 24/7 at a fixed setting. That is wasteful and often harmful: it drains the battery (forcing repeat surgery to replace it), and it delivers stimulation even when symptoms are absent — during the medicated ON state, during sleep — where the same current now causes side effects like dyskinesia or speech impairment. Parkinsonian symptoms fluctuate on the timescale of a levodopa cycle; a fixed dose cannot track them.

The adaptive DBS premise is simple: stimulate only as much as the current brain state demands. To do that you need (i) a biomarker that tracks symptom state in real time, and (ii) a control policy mapping that biomarker to stimulation parameters. The rest of this guide develops both.

The biomarker: pathological beta

In Parkinson's disease, the workhorse biomarker is the beta rhythmoscillatory power in roughly 13-30 Hz recorded from the subthalamic nucleus. Beta power rises with rigidity and bradykinesia and falls with levodopa and with effective DBS. Crucially, beta is not tonic but comes in bursts; long bursts are the pathological feature, which suggests suppressing burst duration rather than average power.

\beta(t) = (1-\alpha)\,\beta(t-1) + \alpha\,\big|\,\mathcal{H}\{x_{\mathrm{bp}}\}(t)\,\big|^2

A real-time beta-power estimate: band-pass the LFP to 13-30 Hz, take the analytic-signal envelope via the Hilbert transform, square it, and smooth with a leaky integrator (0 < alpha < 1). This is the control signal the policy reacts to.

A recipe for tracking how strong the pathological beta rhythm is, moment to moment: filter the brain signal to the beta band, use the Hilbert transform to read its instantaneous amplitude, square it to get power, and average with a "leaky" memory so the estimate is smooth yet still responsive. This number is what the controller watches.

\beta(t)
The running estimate of beta-band power at time t — the biomarker.
\alpha
The smoothing weight (0<\alpha<1); larger means faster to react but noisier.
\mathcal{H}\{x_{\mathrm{bp}}\}
The Hilbert transform of the band-passed signal, giving its analytic-signal envelope.
|\cdot|^2
Squaring the envelope to turn amplitude into power.

With \alpha near 0.1 each new sample nudges the estimate only a little, so a single noisy blip barely moves \beta(t), but a sustained rise in beta pulls it up within a few tenths of a second.

Control policies: on-off and proportional

Two families of policy dominate. Threshold / on-off control ramps stimulation on when beta crosses a high threshold and off when it drops below a low one — a hysteresis band that prevents chattering. Proportional (continuous) control instead sets the amplitude as a graded function of the biomarker error, tracking symptom state more smoothly.

A(t) = \mathrm{clip}\!\big(A_0 + G\,[\beta(t) - \beta^{\star}],\; A_{\min},\; A_{\max}\big)

A proportional control law: stimulation amplitude tracks the beta error above a target level, with gain G and hard limits A_min, A_max. A_min is often kept above zero so the loop never fully opens — a safety and comfort choice.

Turn the stimulation up in proportion to how far the beta biomarker sits above its target, then clamp the result between a floor and a ceiling. It's a thermostat for the brain: more symptoms (higher beta) means more stimulation — but never below a comfort floor or above a safety cap. See adaptive DBS.

A(t)
The stimulation amplitude delivered at time t.
\beta(t) - \beta^{\star}
The error — how much the biomarker exceeds its target \beta^{\star}.
G
The gain — how hard the loop reacts to a given error.
A_{\min},\,A_{\max}
The hard floor and ceiling on amplitude; A_{\min} is often kept above zero.

If the beta error doubles, a proportional law doubles the extra stimulation G\,[\beta - \beta^{\star}] — until it hits A_{\max}, after which more error changes nothing.

s(t) = \begin{cases} \mathrm{ON}, & \beta(t) > \theta_{\mathrm{high}} \\ \mathrm{OFF}, & \beta(t) < \theta_{\mathrm{low}} \\ s(t{-}1), & \text{otherwise} \end{cases}

Dual-threshold (hysteresis) on-off control. The gap between theta_high and theta_low sets robustness to noise: too narrow and the stimulator chatters; too wide and it responds sluggishly.

A stimulator with a "dead band" so it won't flip on and off constantly: switch ON only when beta rises above a high line, switch OFF only when it drops below a lower line, and otherwise just hold whatever it was doing. The gap between the two lines buys immunity to noise.

s(t)
The on/off state of the stimulator at time t.
\theta_{\mathrm{high}}
The upper threshold that triggers ON.
\theta_{\mathrm{low}}
The lower threshold that triggers OFF.
s(t{-}1)
"Otherwise, keep the previous state" — the memory that creates hysteresis.

If the two lines sit far apart, a beta value wobbling in the middle leaves the stimulator untouched; squeeze them together and the same wobble makes it chatter on and off.

# Adaptive DBS control loop (runs every ~50-100 ms)
beta, state = 0.0, 'OFF'
while True:
    x     = read_sense_channel()          # LFP, blanked around each stim pulse
    x_bp  = bandpass(x, 13, 30)           # beta band (Hz)
    power = abs(hilbert(x_bp))**2         # instantaneous beta power
    beta  = (1-alpha)*beta + alpha*power  # leaky smoothing
    if   beta > theta_high: state = 'ON'
    elif beta < theta_low:  state = 'OFF'
    amp = clip(A0 + G*(beta - beta_target), A_min, A_max)
    set_stim(on=(state=='ON'), amp=amp, freq_hz=130, pw_us=60)
The full sense-decide-stimulate loop in pseudocode: estimate beta power, apply the hysteresis and proportional rules, then command the stimulator. Loop period and smoothing constant alpha set the effective control bandwidth.

Responsive stimulation for epilepsy

Responsive neurostimulation (RNS) closes a different kind of loop. Rather than continuously regressing a graded biomarker, it runs fast detectors (line-length, area under the curve, band-pass energy) that watch for the electrographic signature of a seizure onset, and fires a brief stimulation burst to abort it before it spreads. The control problem is rare-event detection, not continuous regulation — you optimize for high sensitivity at an acceptable false-positive rate, and the payload is a burst, not a dose curve.

The read-write problem

The deepest engineering obstacle to closing the loop is that writing blinds reading. The stimulation pulse is millivolts-to-volts; the beta biomarker is microvolts. The standard defense is blanking: disconnect or ignore the sensor for a short window around each pulse and sense in the gaps between pulses. Artifact rejection by template subtraction can recover more, but amplifier saturation and recovery transients make sensing during stimulation genuinely hard.

An elegant turn is to make the artifact itself the signal. Evoked resonant neural activity (ERNA) is a high-frequency ringing the tissue produces in response to DBS pulses; its amplitude and frequency track electrode location and disease state, and because it is time-locked to the stimulus it is far easier to isolate than spontaneous beta. ERNA is emerging as a robust target-engagement and feedback biomarker precisely because it lives in the stimulation epoch rather than fighting it.