Skip to main content
Hardwave components can emit runtime diagnostics when operating limits are exceeded (motor thermal runaway, battery over-discharge, over-current, and more). Unlike wiring ERRORs (which block simulation at validation time), runtime faults describe what happens during a simulation when physics pushes a component out of spec.

Diagnostic levels

ERROR is reserved for graph validation. FAULT is for mid-simulation catastrophic failures.

Built-in fault-aware components

DCMotor

Outputs health and fault_code in addition to angular_velocity, current, and winding_temp. Key parameters: max_winding_temp (default 130 °C), max_continuous_current (default 5 A), warning_temp_fraction (default 0.9).

LiPoCell

Reading diagnostics from results

Diagnostics are included in result.to_dict() with step_index, timestamp, value, and threshold when applicable.

Fault modes

SimulationConfig.fault_mode controls how the engine responds to FAULT-level diagnostics:

Wiring health into control logic

Connect a component’s health output to an MCU GPIO input to test firmware shutdown behaviour:
health is a ControlSignal: 0.0 = OK, 1.0 = warning, 2.0 = fault.

Adding faults to custom components

Override two hooks on Component:
Add health and fault_code output ports to expose state on the graph:
The engine calls post_solve_diagnostics() after every solve step and populates health / fault_code automatically when those ports exist.

Error Handling Reference

Full exception hierarchy and validation diagnostic codes