Inspiration

Inverters drive solar plants, EV motors, industrial drives and air-conditioning compressors. When one power switch stops conducting (a failed gate drive, a lifted bond wire), protection usually does not trip: the drive keeps running with distorted currents and stresses the other parts until a bigger failure. In an industry survey, power semiconductor devices ranked as the most fragile converter components (Yang et al., IEEE Trans. Ind. Appl., 2011). Simple threshold detectors catch the textbook fault, but a current-sensor offset can look the same to them. A good technician would run a quick test to tell them apart. I wanted an agent that does that test itself, safely, and explains what it found.

What it does

A simulated three-phase inverter runs live in the web app. You inject an open switch, an open leg, a sensor error or a load change, or press Mystery fault. Then:

  1. A deterministic edge monitor computes normalized mean currents, KCL residuals and an ω-spectrum every cycle and raises an alarm. When the app runs locally with an Arduino UNO R4 WiFi plugged in over USB, the monitor runs on the board instead, fed the simulated currents: the board's alarm starts the diagnosis, its LED matrix follows the agent, and a push button (or a jumper wire) on its pin D2 fires a mystery fault.
  2. Nemotron 3.5 Lightning triages the alarm, with Nemotron 3 Nano as an automatic fallback (in the video's runs Lightning timed out and Nano took over).
  3. Nemotron 3 Super, with tool calling, tests the possible causes on a physics digital twin, runs a safe modulation-step test on the plant when a sensor error and a switch fault look alike, and pulls the IGBT module's datasheet, failure evidence and part links through Tavily.
  4. A safety interlock written in code approves or rejects every test and action. With the datasheet's verified current rating it derates the drive so the predicted peak stays under 50 % of the module's rating.
  5. Nemotron 3 Ultra writes a technician work order with the evidence, actions taken and next steps; code adds the part links and sources from the Tavily results.

Everything is on screen: waveforms, Park's vector, the ω-spectrum, each agent step with model, tokens, latency and cost, the twin's ranking, measured-vs-twin overlays, the interlock's verdicts and the Tavily sources. Without keys, or when a spending cap is hit, the same interface plays recorded diagnoses.

The physics behind the agent's test

The monitor uses textbook features. With Park's vector modulus as the scale, the normalized mean current of phase k is

$$\mu_k = \frac{\overline{i_k}}{|i_s|}, \qquad |i_s| = \overline{\sqrt{i_\alpha^2 + i_\beta^2}}$$

An open upper switch in leg A gives μ ≈ [−0.42, +0.21, +0.21], at m = 0.8 and at m = 0.4 alike. The true phase currents always sum to zero, so a residual in the measured sum points to a sensor:

$$r_{KCL,dc} = \frac{\left|\overline{i_a + i_b + i_c}\right|}{|i_s|}$$

A current-sensor offset δ also shows up as a mean current, but its normalized mean is about \(\delta / |i_s|\), so it grows when the modulation index m (and with it |i_s|) drops. An open switch's μ stays put. That is the test the agent asks for: m from 0.8 to 0.5 gives a μ ratio of about 1.0 for a switch fault and about 1.6 for an offset.

How I built it

  • Physics in Python: a switching-cycle-average model of a two-level inverter with an RL load and an isolated neutral (the neutral voltage follows KCL over the conducting phases), with numba for speed. The plant adds 0.5 % noise and ±5 % R and L tolerances that the twin does not know. The twin fits each look-alike's size (offset, gain, R factor) with a 1-D search and scores the match in % of \(|i_s|\).
  • Models on Nebius Token Factory through the OpenAI Python SDK: one client and one spend ledger route each role to a different Nemotron size. Lightning triages with a JSON schema and reasoning off; Super runs the agent with OpenAI-style tools and brief reasoning; Ultra writes the work order, streamed, with Super started in parallel as a hedge.
  • Tavily search and extract, cached, with a relevance filter, and a fresh live call in every diagnosis.
  • Streamlit and Plotly for the app, pydantic for every schema, and 380+ offline pytest tests with fake models, a fake Tavily and a fake board.
  • An edge node: C++ firmware on an Arduino UNO R4 WiFi (Arm Cortex-M4, 48 MHz) gets 100 samples per phase per cycle at 460800 baud and runs the monitor's features and checks itself. On 12 scenarios its μ differed from the Python monitor's by at most 0.0031, with the same alarms on the same cycles.
  • An evaluation on 24 scenarios with fixed seeds, comparing a textbook detector, Super alone and the full agent, plus an ablation without the web tools.
  • The demo video was screen-recorded with a Playwright script that clicks through the app, so I could film the board with my phone during the same run. The clicks are automated; every diagnosis in it is live.

Challenges I ran into

  • Small models misread raw numbers. With reasoning off, Lightning got 5 of 13 converter faults right from raw features. Once code evaluated the rule table and the model only read "holds: true/false", it got 28 of 28 (14 saved inputs, run twice); in the evaluation it named the right family in 17 of 18 alarms, and the twin still decided.
  • Ultra's latency swung widely. For about ten minutes one morning it took 90–120 s to send its first token; over the next two hours it wrote a whole work order in 1.4–2.4 s. I hedge it with Super: if Ultra has no first token within 10 s or has not finished within 30 s, Super's work order is shown at once.
  • Models that sound right. Super sometimes claimed a result from a test it had not run, or named the wrong side of a switch. Code now checks every final answer against the twin and the tool results and sends it back.
  • The evaluation exposed two design gaps: a two-switch fault was called a single switch, and one open-leg run hit the agent's own 90 s time limit. Both were fixed afterwards and checked on development seeds only; the published table is the first run.
  • Off-topic web results: one failure-evidence search on current-sensor gain errors returned only pages about the word "cause" (a dictionary entry, health pages, a divorce study), so evidence now passes a relevance filter.

Accomplishments that I'm proud of

  • The agent reproduces a technician's reasoning: on a 3 A sensor offset, where the textbook detector calls an open switch, it sees a KCL residual, runs the modulation test (μ grows 1.60 times, as an offset predicts) and concludes "sensor fault, converter healthy".
  • Across the 89 diagnoses saved by 22 Oct, Super made 550 tool calls; only 4 fell outside the declared schema, and the JSON fallback was never needed.
  • A full diagnosis costs a median $0.018 of Token Factory credit, work order included.
  • An honest evaluation with every run reported, failures included.

What I learned

  • Let the model plan and explain, and let code compute and decide. The physics, the safety limits and the checks are code; the model chooses what to test next and writes for a person.
  • Small models are fast and cheap for triage when code hands them evaluated facts rather than raw numbers.
  • Web evidence matters most where it changes a decision: the datasheet's current rating sets the derate.

What's next for FaultTwin

  • Hardware in the loop on a low-voltage inverter, with the edge node reading real current sensors on its ADC instead of the streamed simulation.
  • Triage running locally on edge hardware such as a Jetson Orin Nano (designed for it, not yet done).
  • Short-circuit and gate-driver degradation faults, and other inverter topologies.

How it maps to the judging criteria

Impact. Open-circuit faults keep a drive running degraded and unnoticed; FaultTwin turns one into an approved derate and a work order a technician can act on. The target users are maintenance teams for drives, solar inverters and compressors. In the evaluation it raised no false alarm on 11 non-faults, where the textbook detector raised two, and it told converter faults apart from everything else (sensor errors, load changes, a healthy converter) in 23 of 24 scenarios; six of the 11 non-faults raised no alarm, so the agent did not run on them.

Technical implementation. Nemotron models on Token Factory, each sized to its job: Lightning for triage (Nano as its fallback), Super for the tool-calling agent, Ultra for the work order. The tools do the physics: a digital twin with fitted look-alikes, a safe active test, and datasheet facts through Tavily. Code checks the safety of every action and the evidence behind every answer. On 24 scenarios the exact label was right in 18, against 10 for a textbook detector and 14 for Super alone without tools, at a median $0.018 per diagnosis.

Design. One flow from fault to work order on a single screen: the plant, the monitor, every agent step with its model, cost and latency, the twin overlays, the interlock's verdicts, the sources and a downloadable work order. The demo never shows a blank page: recorded diagnoses play in the same interface when keys or budget run out.

Why this idea is non-obvious. The agent does not just classify the waveforms; it experiments: it asks for the modulation-step test described above, a code interlock checks the predicted peak current of every plausible cause first, and the twin, not the model, confirms the answer. Tavily's datasheet rating then sets the safety limit: the derate changed in 6 of 8 runs (m = 0.66 instead of a blind 0.40).

Built With

Share this project:

Updates

Submission history