Get in Touch
Back to Projects

·9 min read

SANEL Power Test Suite: A Test and Production Platform for USB Power Delivery Chargers

A USB PD test platform that brings the PassMark PM240 and PM125 testers into one Windows interface, with revision-controlled test recipes, RFID roles, live measurement and traceable logging. I'm building it for the production line during my internship at SANEL Auto Electronic.

Tags:automotiveusb-pdcsharpdotnetwpfproduction-test
Mission 08 · SMT-22In progress· Windows (WPF) · .NET 10Last updated: My role: Software developer intern · SANEL Auto ElectronicSee it in SMT-22 ↗

Industry project

A USB PD test platform for the production line

Turning a powerful tester from a hand-operated lab tool into part of a repeatable, traceable production system.

SANEL Auto Electronic · internship project

OK, NOK, CANCELLED and ERROR are separate results, so a product failure never hides behind a test-rig failure.

Mission specs

Under test
USB-C PD chargers (up to 100 W) and in-vehicle USB-C charging modules
Testers
PassMark PM240 (240 W, EPR) and PM125 (60 W continuous, 100 W timed)
Platform
.NET 10 + WPF, CommunityToolkit MVVM · 64-bit Windows 10/11
Users
Production-line PCs · RFID sign-in with Operator, Manager and Admin roles
Recipes
Revision-controlled test recipes: Draft → Published → Withdrawn → Archived
Logging
Live CSV + a JSONL of every frame · a separate JSONL per test · SQLite

Mission log

Every change to the project is logged here with its date, newest first.

  1. Site

    Project page published.

  2. Development

    PM240 and PM125 support, a live engineering screen, revision-controlled recipes, RFID roles, the operator test screen, CSV/JSONL logging and a hardware-free simulation mode. Being prepared for production along with poka-yoke checks.

Next steps

  • Poka-yoke (error-proofing) checks
  • Central result upload and company-specific reporting

Technical report

Architecture, hardware and software in detail.

Introduction: a charger isn't just 5 volts any more

USB chargers are no longer simple power supplies with a fixed voltage. With USB-C Power Delivery, the source and the sink negotiate supported voltages, current limits, cable capabilities and the power contract digitally. That flexibility makes testing harder: it isn't enough for a product to deliver power. It has to advertise the right PD profiles, switch to the requested voltage, stay stable under load, stay within its limits, and the whole process has to be traceable.

SANEL Power Test Suite is the Windows application I'm building for this during my internship at SANEL Auto Electronic. It brings the PassMark PM240 and PM125 testers, used to test 100 W USB PD chargers, into a single interface, and combines engineering measurements, test recipes, the operator flow, user authorisation and logging in one system. It's designed to run on the production PCs in the manufacturing plant.

The project isn't finished yet; I'm still developing it. Poka-yoke (error-proofing) checks will be added before it goes into production.


🔌 More than a single measurement screen

The starting point was to simplify the scattered test process of working with two different PassMark devices. The PM240 and PM125 belong to the same product family, but their connection methods, command sets, supported functions and safety limits differ. So a shared UI wasn't enough: the application had to identify each device correctly, send only that model's commands, and never offer the user a feature the device doesn't support.

On start-up the app scans for connected devices, verifies their identity and lists them as device cards. Selecting one opens the control surface for that model. Live telemetry, charts, the event log and basic load control are shared; tools such as ripple, FFT, the virtual charger, the step-load test or the message generator only appear on the model that supports them.

FeaturePM240PM125
Main useHigh-power USB PD and EPRUSB PD SPR and production testing
Load capacity240 W continuous, 48 V and 5 A60 W continuous, 100 W timed
PD profilesFIX, PPS, AVS and EPRFIX and PPS
Source portUp to 20 V and 5 ANone
Special toolsRipple, FFT, cable and virtual chargerStep load and message generation
CalibrationFour channelsTwo channels

The software treats the PM125's 60 W continuous and 100 W timed limits separately: in the high-power region a time budget is tracked, and if the time or temperature limit is exceeded, the load is safely reset to zero.


⚡ How a USB PD test really works

When testing a charger, the PM240 or PM125 isn't the side sending voltage to the product. The charger under test is the source, and the PassMark tester is the electronic load drawing power. The tester first reads the PD profiles the product advertises, then selects the profile from the scenario, sets up, say, a 9 V or 20 V contract, and draws the specified current from the product.

For example, 20 V at 5 A is a 100 W test point. But to apply it, the product has to actually advertise a 20 V / 5 A profile, the cable has to support 5 A, and the product's input has to be able to supply that power. The software doesn't force a profile the product doesn't advertise in a normal production test, so the scenario value never gets confused with what the physical system can really do.


📈 The live engineering screen

The engineering screen is designed to show the device's current state at a glance. Voltage, load current, total current, power, temperature and loopback readings each get their own card, and a live chart plots voltage, current and power over time. The profile list shows every PDO and APDO the product advertises. Load control works together with the active profile and the device's electrical limits; an invalid current value is never applied directly.

  • Fixed PD, PPS, AVS and EPR profile selection
  • Electronic load and load slew-rate control
  • Ripple and FFT signal analysis on the PM240, step-load response on the PM125
  • USB PD protocol analyser and per-model message generation
  • Device configuration, calibration and capacity measurement
  • A searchable, colour-coded event log

🧾 Revision-controlled test recipes

On a production line, every product has to get the same measurements in the same order with the same acceptance criteria. In the recipe library, a manager defines for each step the PD voltage, load current, measurement time, voltage and current tolerances, settling time and load slope; the system calculates the target power and checks it against the tester's limits. Each step runs like this:

  1. The current load is safely reset.
  2. The requested PD profile is selected and the contract is confirmed from the device.
  3. The target load command is sent.
  4. The app waits for voltage and current to reach the stability band.
  5. A set number of consecutive stable samples is taken.
  6. The stable measurement window starts and acceptance criteria are evaluated.
  7. The step result is added to the permanent record.

This prevents premature NOK verdicts on electronic loads that ramp up slowly: the tester accepting the command isn't enough, measurement starts once real telemetry reaches the target band. If the target isn't reached in time, the record clearly states the requested value, the highest value reached and the elapsed time.

Published recipes are never edited in place. Edit opens a new draft revision, and earlier test results stay linked to the old revision:

StateMeaning
DraftPrepared by a manager, invisible to operators
PublishedSelectable in production tests
WithdrawnClosed to new tests, past results kept
ArchivedRemoved from active lists, audit trail kept

Drafts that were never published or used in a test can be deleted; recipes used in production are archived, because they underpin the test history.


🪪 Three-level authorisation with RFID

Typing a username and password at a test station slows production down. The app supports quick sign-in with RFID readers that behave like a keyboard. Card numbers aren't stored directly; they're matched to users through DPAPI- and HMAC-based digests.

RoleScope
OperatorRuns published tests; sees the result and their own test history
ManagerManages the engineering screen and the recipe lifecycle
AdminEverything above plus user, RFID and role management

Operators can't change the test scenario, can't reach engineering commands and can't see other users' records. Safety actions such as resetting the load and safely detaching the product remain available in every role.


✅ The operator screen and the OK / NOK rules

The operator screen shows what's needed to make a decision without distractions. The operator picks a published recipe, enters the product serial number and lot if required, and starts the test. During the test the recipe and revision, active step, voltage, current, power, temperature and per-step results are shown. The live log writes readable lines such as "profile found, contract confirmed, load applied, waiting for stability, measurement started, result saved"; raw protocol bytes are never shown to the operator. When the test ends, a large OK or NOK, the serial number and the record ID stay on screen.

The system never gives an OK by looking only at the last voltage. An OK requires every step to finish within acceptance limits, enough fresh samples, the tester's identity confirmed throughout, the load seen safely reset, and the result written to the permanent record:

  • OK: every step and the record succeeded.
  • NOK: a measurement is outside acceptance limits, or the target wasn't reached in time.
  • CANCELLED: the user stopped the test in a controlled way.
  • ERROR: a communication, stale-measurement, identity, logging or safety problem.

This keeps a product failure and a test-rig failure from disappearing under the same result.


🗂️ Layered logging and traceability

Every application session writes, in real time, a CSV log that opens in Excel and a technical JSONL log containing every frame sent to or received from the device. Each production test also gets its own JSONL file: a full copy of the recipe, its revision, the operator, serial number, lot, tester model and serial, firmware, step commands, measurement samples, acceptance limits, the verdict and its reasoning. Lines are flushed to disk immediately, so even if the application closes unexpectedly, everything recorded up to that moment is kept.


🛡️ An architecture that protects the hardware

In the PM240 and PM125 protocols, the same opcode can do different things. The most critical example is 0xE0: on one model it reads configuration, on the other it can mean writing to non-volatile memory. Sending the wrong command to the wrong device could change its configuration unintentionally. So:

  • PM240 and PM125 opcodes are represented by separate types.
  • No command except the identity query is sent before the device's identity is verified.
  • Unknown connections only get a safe, minimal identification packet.
  • Device identity is re-verified throughout the session.
  • Persistent configuration requires a separate confirmation and a session limit.
  • Every frame sent is written to a technical audit trail.

The architecture has three layers: Core holds models, capabilities, test rules and safety checks; Infrastructure handles serial communication, device drivers, SQLite stores, authentication and logging; and the WPF app presents the UI and workflow with MVVM. This separation lets the hardware code be tested independently of the UI.


🧰 Technologies

  • .NET 10 and WPF, a 64-bit Windows 10/11 application
  • CommunityToolkit MVVM separating views from business logic
  • SQLite for local users, recipes and test results
  • ScottPlot for live voltage, current and power charts
  • Per-model serial communication over USB CDC and FTDI
  • DPAPI- and HMAC-based protection for RFID card digests
  • Real-time CSV and JSONL logging
  • A hardware-free simulation mode for the PM240 and PM125: it mimics the real device protocol, so the UI, scenarios, role flows and error cases can be tried without a tester
  • A single-file portable package and a Windows installer

🚗 Where it fits in automotive electronics

An in-vehicle USB charging module is more than a USB port: the vehicle supply input, USB PD controller, power stage, cable, thermal design and software all work together. SANEL Power Test Suite handles profile negotiation, load behaviour and measurements on the USB output side; the 12 V or 24 V supply conditions at the vehicle input come from an external lab supply and fixture.

The system helps apply the acceptance values in an OEM specification and track the results; on its own it doesn't provide USB-IF certification or automotive standard compliance. Supply transient tests such as ISO 7637-2 additionally need a suitable generator, coupling network and a validated test plan.


🎯 Conclusion

The project's most important contribution is turning a powerful tester from a hand-operated lab tool into part of a repeatable, traceable production system. Engineers get detailed device control and protocol tools, while operators just pick the right recipe and run a safe test flow; recipe revisions, user permissions, product identity, measurements and results all end up in the same chain of records.

The platform is designed to grow: new device drivers, new test steps, central result upload or company-specific reporting can be added to the existing layered architecture. The latest progress is in the mission log at the top of this page.