diagnose_vibration
Detect bearing faults and assess ISO 20816-3 severity from a stored vibration signal using FFT, PSD, and STFT analysis.
Instructions
Full integrated diagnosis: FFT + PSD + STFT + bearing faults + ISO severity.
Comprehensive vibration diagnostic pipeline. Loads signal from repository,
runs all analyses, and synthesizes results into an actionable report.
The ISO severity block uses ISO 20816-3 machine group/support type
(zone boundaries from ISO 10816-3:2009, provenance noted in output).
The diagnosis DEGRADES instead of failing when the ISO verdict cannot
be produced honestly: if the stored signal has no declared unit (or
the sampling rate cannot cover the ISO evaluation band), the
iso_severity block is a structured refusal (status='refused' with
reason and remedy) while the spectral, bearing, and anomaly blocks
still run. Units are never guessed from amplitude — declare them via
load_signal(signal_unit=...) or the companion _metadata.json.
Diagnostic parameters default to the DECLARED context of the signal
(the result's parameter_sources block says where each value came
from): an explicit argument always wins; rpm then falls back to the
rpm declared in the companion's "measurement" object, then to the
nominal_rpm of the measurement point's current declaration in the
asset ledger (declare_measurement_point), and with no source anywhere
the call is refused, never defaulted; bearing_id, machine_group and
support_type fall back to the point's current declaration, and
machine_group / support_type then to the historical defaults 2 and
'rigid' (without a bearing anywhere the bearing block is skipped). A
point declared with fault_orders but no bearing_id gets no bearing
block in this stage — frequency sets are not supported here; the
result says so and names check_bearing_faults(frequencies=...). A
signal loaded without a measurement identity behaves exactly as
before: only the explicit arguments and the historical defaults apply.
Args:
ctx: MCP context. Unused — see this module's docstring on logging.
signal_id: ID of the stored signal.
rpm: Machine operating speed in RPM. Optional: the measurement's
declared rpm, then the point's nominal_rpm.
bearing_id: Bearing designation for fault detection. Optional: the
point's declared bearing_id.
machine_group: 1 (large, >300 kW) or 2 (medium, 15-300 kW).
Optional: the point's declaration, then 2.
support_type: 'rigid' or 'flexible'. Optional: the point's
declaration, then 'rigid'.
Raises:
ValueError: If the stored signal has no sampling rate, if no rpm
can be resolved from the call, the measurement or the point
(the message names the three remedies), or if the point's
declaration carries a malformed value.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rpm | No | ||
| signal_id | Yes | ||
| bearing_id | No | ||
| support_type | No | ||
| machine_group | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rpm | Yes | Machine speed (RPM) | |
| signal_id | Yes | Signal identifier used | |
| bearing_id | No | Bearing used (if any) | |
| fft_summary | Yes | FFT key findings | |
| psd_summary | Yes | PSD key findings | |
| iso_severity | Yes | ISO severity assessment, or a structured refusal (status='refused' with reason + remedy) when the verdict cannot be produced honestly — e.g. undeclared signal unit or Nyquist below the ISO evaluation band. The other diagnosis blocks (spectral, bearing, anomaly) still run. | |
| stft_summary | Yes | STFT key findings | |
| support_type | Yes | Support type used for severity: 'rigid' or 'flexible' | |
| machine_group | Yes | ISO 20816-3 machine group used for severity: 1 (large) or 2 (medium) | |
| bearing_faults | No | Bearing fault results | |
| recommendations | Yes | Recommended actions | |
| anomaly_detection | No | Anomaly detection results (health, ratio, score) | |
| evidence_strength | Yes | Strength of corroborating fault evidence: 'none', 'weak', 'moderate', or 'strong'. Derived from the number and quality of independent findings (bearing fault frequency matches, shaft signatures, anomaly detection, ISO severity) — NOT from severity alone and NOT a probability. 'none' means no fault evidence was found (machine appears healthy). | |
| overall_diagnosis | Yes | Combined diagnostic text | |
| parameter_sources | No | Origin of each diagnostic parameter, keyed rpm, bearing_id, machine_group and support_type. Precedence: 'explicit' (passed to the call) > 'measurement' (the rpm declared in the companion's "measurement" object) > 'point' (the current declaration of the measurement point in the asset ledger: nominal_rpm, bearing_id, machine_group, support_type) > 'default' (the historical machine_group=2 / support_type='rigid'; rpm has no default and is refused instead). bearing_id only: 'none' (no bearing from any source, bearing block skipped) or 'not_supported_fault_orders' (the point declares fault_orders without a bearing_id: the bearing block was not computed because frequency sets are not supported by diagnose_vibration in this stage; use check_bearing_faults(frequencies=...)). |