tDCS/TMS Peripherals: Isolated Drive, Monitoring & E-Stop
← Back to: Medical Electronics
This page explains how to build a provable safety loop for tDCS/TMS peripherals: from current-set control and isolation, to patient-loop monitoring, hardwired interlocks, and deterministic safe states. It provides practical gating rules and verification tests so stimulation is only enabled when the loop is trusted—and shuts down safely when it is not.
H2-1 · What this page covers (Peripherals only)
Scope is limited to the peripheral safety loop: setpoint → isolation/drive → patient loop → monitoring → interlock/E-stop. The main TMS high-energy pulse power stage is intentionally excluded.
Reusable deliverables for architecture review and DFMEA:
- Gate points: setpoint validity, isolation integrity, loop integrity, enable gating, interlock latch
- Fault-to-safe mapping: measured symptom → threshold → action (disable / clamp / latch / manual reset)
- Verification checklist: timing, false-trip robustness, single-point fault behavior
H2-2 · tDCS vs TMS: what “peripheral” means in both
“Peripherals” map to different engineering priorities. tDCS peripherals center on mA-level regulated current and contact quality gating. TMS peripherals center on trigger permission, coil state and hard interlocks (still excluding the main pulse power stage).
- tDCS focus: setpoint accuracy, drift control, Z-loop/lead-off detection, controlled enable & ramp
- TMS focus: trigger permit chain, coil present/ID, coil temperature/status, interlock latch & manual reset
- Shared spine: E-stop/interlock must gate both lanes through a latchable “permit gate”
H2-3 · Current-set DAC architecture that stays stable
The setpoint chain must remain predictable under drift, noise, electrode impedance changes, and update transients. A stable architecture combines calibration, bandwidth control, clamp + soft-start, and a permit gate that only enables output when safety conditions are true.
Two practical implementation routes
| Route | Strength | Watch-outs |
|---|---|---|
|
DAC → Vset → I-source (Howland / transconductance / mirror) |
Fine control of ramp, clamp, compliance detection and gating; easy to embed sense checks. | Resistor ratio and amplifier drift; compliance limits under high loop impedance; update glitches need filtering. |
|
Current-output DAC (shorter analog chain) |
Reduced analog stages; simpler signal path; predictable monotonicity when properly referenced. | Output behavior on link loss or reset must be fail-safe; drift and reference quality dominate performance. |
Stability toolbox (what makes it “safe & repeatable”)
- Resolution vs noise: define the smallest meaningful current step (ΔI) and limit setpoint bandwidth to avoid false trips in monitoring.
- Zero & gain calibration: store CalVersionID and validate it before enabling output; a failed calibration blocks stimulation.
- Clamp + soft-start: hardware clamp bounds the output; ramp control limits dI/dt and reduces contact transients.
- Permit gate: output is enabled only when interlock OK, loop integrity OK, no latched fault, and setpoint is valid.
- Compliance awareness: detect when loop impedance forces the I-source into voltage limits; trigger downgrade or shutoff.
Verification checklist (bench + production)
- Static accuracy: multi-point Iset vs measured current (include near-zero points).
- Transient behavior: step setpoint and confirm ramp rate, overshoot, and settle time meet limits.
- Impedance sweep: vary loop impedance and verify compliance detection and safe action.
- Fault injection: DAC stuck, reference missing, setpoint link loss → output must disable and/or latch fault.
- Cal gating: invalid CalVersionID must block the permit gate.
H2-4 · Isolated drive stage: what must cross the barrier
Isolation should pass only the signals that are required for safe control. Each crossing must be defined with a fail-safe default so that link loss, reset, or brownout cannot accidentally produce output.
Minimum cross-barrier signal set (with fail-safe intent)
- Setpoint (Vset / digital command): if missing or stale → output must be disabled by the permit gate.
- Enable / Permit (hard gate): open/unknown → default disable.
- Fault latch (latched inhibit): asserted → disable output until manual reset condition is met.
- Status (ready / supply good / loop ok): loss of status must not grant permission; it can only make behavior more conservative.
- Measurement feedback (optional) (I/V / loop metrics): if not trustworthy → disable or downgrade per policy.
Partition options (peripheral-level isolation strategy)
- Analog setpoint crossing: Vset crosses the barrier; patient-side uses a gated drive stage. Requires strong filtering and drift awareness.
- Digital setpoint crossing: patient-side generates the setpoint locally; barrier carries commands + permit + fault. Requires timeout/staleness handling.
- Common rule: patient-side must have a clear default safe state (output disabled + bounded by clamp) when power or data is not valid.
Fault behaviors that must be proven
- Isolation-side brownout: output must disable and remain bounded by clamp.
- Permit stuck high: a separate interlock/fault path must still force disable.
- Setpoint stale: output must disable unless periodically refreshed and validated.
- Fault line loss: behavior must become conservative (never “accidentally allow”).
- Measurement missing: disable or downgrade; never allow full output based on missing feedback.
H2-5 · Patient-loop monitoring: what to measure and why
Loop monitoring turns “unknown electrode contact” into a measurable safety decision. The minimum set of signals is I_sense and V_sense, plus an impedance estimate used for gating, derating, and prompting electrode re-application when contact quality trends worse.
What to measure (and what each one catches)
- Continuity (open / short / high-Z contact): fast protection against broken or unsafe connections.
- Actual I and V: detect mismatch between setpoint and delivered output and identify compliance limits.
- Contact impedance trend (Z ≈ V/I in valid windows): early warning for gating and controlled derating.
Decision actions (typical policy)
- Loop OK: permit on, normal stimulation allowed.
- Z warning / rising trend: permit on, derate and prompt “reapply electrodes”.
- Open suspected (V high, I low): permit off and stop output; latch if repeated or persistent.
- Short suspected (V low, I high): permit off; typically latch and require manual reset.
- Sense mismatch (Iset vs Iactual out of window): inhibit until stable and verified.
Verification checklist
- Impedance sweep: verify open/short/high-Z classification and thresholds.
- Motion artifacts: ensure filters and time-qualification prevent nuisance inhibits.
- Slow drift: confirm trend logic triggers derate + prompt before hard stop.
- Fault injection: break I_sense or V_sense and confirm behavior becomes conservative.
H2-6 · Lead-off / electrode detect without false trips
Lead-off detection must be sensitive without becoming noisy. Robust designs combine a small-signal probe, window decisions, and time qualification (debounce) with blanking around plug/unplug and output transitions.
Detection methods (layered)
- AC probe: inject a small test signal in defined windows and estimate contact impedance.
- Window compare: classify open/short tendencies using I/V windows with hysteresis.
- Debounce: require persistence (T_ms) or repeated hits (N-of-M) before inhibiting stimulation.
Common false-trip traps (and defenses)
- Sweat/gel drift: use trend + hysteresis and derate before hard stop.
- Motion artifacts: use windowed sampling and multi-window agreement instead of single-point decisions.
- Plug/unplug transients: apply blanking and force a re-confirm sequence before re-arming output.
H2-7 · E-stop & interlock chain (hardwired, latchable)
A stimulation peripheral must fail safe. Any unknown, broken, or open interlock condition must force output disable and clamp to a defined safe state. Latchable logic prevents a software-only “revive” after an emergency stop or a safety boundary breach.
Common interlock sources
- E-stop button: direct hardware inhibit for rapid shutdown.
- Door/cover open: boundary open must disable output.
- Connector present: incomplete insertion or removal forces inhibit and re-confirm.
- External system permit: link loss or timeout must default to inhibit.
Latch and shutdown rules
- Fail-safe default: open/unknown = interlock active = output inhibited.
- Hard latch: once triggered, recovery requires manual reset plus verified safe conditions.
- Shutdown path: (1) cut the drive enable, (2) clamp/discharge the output to a defined safe state.
- Optional dual-channel: CH-A and CH-B must agree; mismatch inhibits output.
Verification checklist
- E-stop / door open / connector change → permit low + clamp on within the required time.
- Broken wire or removed sensor → treated as unsafe (no “floating OK”).
- Reset attempt with unsafe inputs → reset must be rejected (latch remains).
- Dual-channel mismatch (if used) → inhibit + event code recorded.
H2-8 · Fault handling: safe states and recovery rules
Fault handling must define a single safe state and a recovery policy. When a fault triggers, the peripheral should force output disabled, clamp engaged, optional timed lockout, and event recording. Recovery rules must prevent immediate re-entry into stimulation without re-arming and re-confirmation.
Defined safe state (what “safe” means)
- Permit low: output stage disabled via hardware gate.
- Clamp on: output driven to a defined safe electrical condition.
- Lockout (optional): timer prevents rapid restart during unstable conditions.
- Event record: store fault code + state + key snapshots (I/V/Z/temp/reset cause).
Typical triggers (peripheral-level)
- Electrical: over-I, over-V, compliance limit, lead-off/open, drift out-of-window.
- Trust loss: watchdog reset, ADC stuck, sensor stuck, invalid calibration ID.
- Thermal: over-temp of the peripheral drive stage (derate → inhibit).
Recovery rules (do not “jump back” to output)
- Auto recovery: only for non-danger, non-trust-loss events; return to Armed after re-confirm.
- Manual reset: for hazardous or repeated faults; requires safe inputs and stable conditions.
- Service reset: for watchdog/ADC stuck/trust faults; requires self-test pass before normal operation.
H2-9 · Calibration & self-test that catches drift early
Calibration and self-test establish trust in the peripheral measurement chain. A valid CalVersionID, recent self-test pass, and drift statistics should be treated as gating inputs for entering Armed and Stim. Loss of trust must default to a more conservative state.
Factory calibration (what gets versioned)
- Offset / gain: I_sense and V_sense zero and known-point alignment.
- Probe path: test injection and readback channel consistency.
- Thresholds: open/short/Z-high and warning windows with hysteresis.
Self-test (power-on + periodic)
- Power-on self-test: verify ADC/sense chain health, interlock defaults, clamp control and basic range checks.
- Periodic self-test: run in quiet windows; inject a small known stimulus via test MUX and validate readback.
- Drift detection: update drift stats; escalate from record → inhibit → service reset when trust is lost.
What to record (audit fields)
- CalVersionID and date, last self-test pass time and result.
- Drift stats: offset/gain/probe trend summary and counters.
- Last fault code with state snapshot (Normal/Armed/Stim) and reset cause (if any).
H2-10 · EMC/ESD robustness for patient connectors (peripheral view)
Patient connectors must survive ESD and transients without damage or unsafe output behavior. The peripheral view focuses on protection components, partitioning, and a defined return path so surge energy is diverted away from sensitive sensing and drive control.
Protection building blocks
- TVS / clamps: limit peak voltage and route energy to the intended return node.
- Series limiting: R / ferrite / small impedance to reduce surge current and ringing.
- RC filtering: slow edges into sensing while keeping valid stimulus bandwidth.
- Partition + return path: keep ESD currents out of sensitive measurement ground.
Avoid false trips and unsafe recovery
- Blanking window: short ignore window for plug/ESD edges before re-confirming lead-off.
- Time qualification: debounce prevents single spikes from causing latch.
- Conservative gating: after a large transient, return to Armed and re-confirm before Stim.
H2-11 · Verification checklist & production tests
This checklist is written as test cases that can be executed on the bench and on the production line. It verifies (1) I-set → I-actual behavior, (2) lead-off detection quality, (3) interlock shutoff latency, and (4) single-point-fault safety (ADC stuck, MCU hang, patient-side power loss). Example part numbers are included for fixture design and fault injection planning.
Test case format (recommended)
- Purpose → Setup → Steps → Observables → Pass/Fail → Records.
- Records: CalVersionID, SelfTestLastPassTime, DriftStats, LastFaultCode, ResetCause, StateAtFault (Normal/Armed/Stim).
- Fixture note (examples): load switching via ADG1409 (ADI) / TMUX1208 (TI) or small-signal relays like Omron G6K.
A) Stim tests (setpoint → actual output)
Setup: Known load bank (precision resistors such as Vishay PTF56 / Dale RN series) + switch matrix (ADG1409 / TMUX1208 / G6K). Scope/DAQ monitors I_sense, V_sense, PERMIT, CLAMP.
Steps: Apply step sequence (e.g., 0 → I1 → I2 → 0) under multiple loads; repeat after warm-up.
Observables: rise/fall time, settling time, overshoot, steady-state error, compliance behavior, unintended interlock trips.
Pass/Fail: transient within spec; no unsafe overshoot; no false latch; steady-state error within allowed window.
Example ICs: DAC AD5686R/AD5696R, current-sense amp INA240/INA190, op amp OPA197/OPA2192, ADC AD7685 or TI class SAR/ΔΣ.
Setup: Sweep load from nominal to high impedance (Z-high vectors) while monitoring I_actual and V_out.
Steps: Increase load impedance until compliance is reached; observe gate policy (derate/inhibit) and user-alert output (if present).
Observables: I_actual deviation, V_out limit behavior, detection latency, state transition (Stim → Armed/Fault).
Pass/Fail: compliance hit must not create unsafe output; state machine must move to a defined safe state and re-confirm before re-entry.
Setup: Two-point check using a known load and a test window (no active stimulation).
Steps: Run quick self-test injection via test MUX; compare readback against stored CalVersionID limits.
Pass/Fail: PASS required to allow entry into Armed/Stim; drift counters updated; FAIL forces inhibit or service reset per policy.
B) Monitor tests (lead-off quality and robustness)
Setup: Impedance vector library: OPEN, SHORT, nominal R, Z-high, and R||C “electrode-like” models.
Steps: Cycle vectors with realistic timing (plug/unplug edges, motion-like intermittency); run detection with debounce enabled.
Observables: FP rate (unwanted inhibit/latch), FN rate (missed open/high-Z), detection delay, re-arm behavior.
Pass/Fail: FP/FN within spec; short spikes must not latch; sustained faults must inhibit quickly.
Example ICs: window/threshold logic with TLV6700 class window comparator; input protection TPD1E10B09/TPD2E2U06 class ESD parts.
Setup: Apply controlled edge events (fast connect/disconnect, injected spikes at connector fixture).
Steps: Validate blanking window + time qualification; confirm re-check after the blanking time.
Pass/Fail: no unsafe output; no permanent lock-ups; must return to Armed and re-confirm before Stim.
Setup: Force known levels and confirm ADC is not stuck and not saturated; validate reference presence.
Fault injection (examples): freeze ADC data-ready, clamp input, or disturb reference.
Pass/Fail: trust-loss must inhibit Stim; event logged (ADC_STUCK / REF_FAULT).
Example ICs: references ADR4550 / REF5050.
C) Interlock & single-point-fault tests (hardwired safety)
Setup: Trigger E-stop / door / connector / external permit while probing INTERLOCK_IN, PERMIT_OUT, CLAMP_EN, V_out.
Pass/Fail: delay within target (e.g., ≤ a few ms); must not depend on MCU ISR timing; safe state must be deterministic.
Steps: Cause an interlock fault; attempt software-only recovery; then apply manual reset with conditions OK / not OK.
Pass/Fail: software must not revive output; manual reset must be rejected unless all safety conditions are true; event recorded.
ADC stuck: freeze bus/DRDY or clamp input → inhibit + fault code (ADC_STUCK).
MCU hang: stop watchdog servicing → watchdog asserts safe state; output remains disabled and clamped.
Patient-side power loss: remove isolated-side supply / PG → immediate safe state; recovery requires re-arm and re-confirm.
Example ICs: watchdog TPS3430/TPS3823, supervisor class MAX16054, digital isolator ADuM141E / Si8661, isolated measurement example AMC1301.
H2-12 · FAQs (tDCS/TMS peripherals)
These FAQs focus on peripheral safety loops only: setpoint generation, isolation boundary signals, patient-loop monitoring, hardwired interlocks, safe states, self-test gating and production verification.