Motor Current Signature Analysis

v0.2.1
io.github.LGDiMaggio/mcp-server-mcsa Checked 1 day ago Published 9 months ago

MCP server for Motor Current Signature Analysis — fault detection in electric motors

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

calculate_motor_params

Calculate motor operating parameters from nameplate and measured data. Computes synchronous speed, slip, rotor frequency, and slip frequency. These parameters are required inputs for fault frequency calculations.

ParameterTypeDescription
poles *integerNumber of magnetic poles (even, ≥ 2)
rotor_speed_rpm *numberMeasured rotor speed in RPM
supply_freq_hz *numberSupply (line) frequency in Hz, e.g. 50 or 60

compute_fault_frequencies

Calculate expected fault frequencies for common induction-motor faults. Computes characteristic frequencies for broken rotor bars, eccentricity, stator faults, and mixed eccentricity based on motor operating parameters. Use these frequencies to know WHERE to look in the current spectrum.

ParameterTypeDescription
poles *integerNumber of magnetic poles
rotor_speed_rpm *numberRotor speed in RPM
supply_freq_hz *numberSupply frequency in Hz
harmonicsintegerNumber of harmonic orders to compute

compute_bearing_frequencies

Calculate bearing characteristic defect frequencies (BPFO, BPFI, BSF, FTF). Returns normalised frequencies (multiples of shaft speed) and, if shaft speed is provided, absolute frequencies in Hz. If supply frequency is also given, computes expected stator-current sidebands.

ParameterTypeDescription
ball_dia_mm *numberBall (roller) diameter in mm
n_balls *integerNumber of rolling elements in the bearing
pitch_dia_mm *numberPitch (cage) diameter in mm
contact_angle_degnumberContact angle in degrees
shaft_speed_rpmnumberShaft speed in RPM (optional, for absolute Hz)
supply_freq_hznumberSupply frequency in Hz (optional, for current sidebands)

preprocess_signal

Preprocess a stator-current signal for spectral analysis. Applies (in order): DC offset removal → notch filtering → bandpass filtering → normalisation → windowing. Returns the preprocessed signal.

ParameterTypeDescription
sampling_freq_hz *numberSampling frequency in Hz
signal *arrayRaw current signal as a list of amplitude values
bandpass_high_hzUpper bandpass cutoff in Hz (optional)
bandpass_low_hzLower bandpass cutoff in Hz (optional)
nominal_currentNominal current for normalisation (A). Omit for RMS normalisation
notch_freqs_hzFrequencies to notch-filter (optional)
windowstringWindow function: hann, hamming, blackman, flattop, rectangular

compute_spectrum

Compute the single-sided amplitude spectrum (FFT) of a current signal. Returns a spectrum_id referencing the stored spectrum, plus a compact summary with top peaks. Use spectrum_id in downstream fault-detection tools.

ParameterTypeDescription
max_freq_hzMaximum frequency to return (Hz). Omit for full range
n_fftFFT length (zero-padding). Omit for auto
sampling_freq_hzSampling frequency in Hz. Auto-resolved when using signal_id.
signalTime-domain signal array. Use signal_id instead for large signals.
signal_idID of a stored signal. Preferred over raw array.

compute_power_spectral_density

Compute Power Spectral Density using Welch's method. Better for noisy signals and trend analysis than a raw FFT. Returns a spectrum_id plus compact summary.

ParameterTypeDescription
max_freq_hzMaximum frequency to return (Hz)
npersegFFT segment length. Omit for auto
sampling_freq_hzSampling frequency in Hz. Auto-resolved when using signal_id.
signalTime-domain signal array. Use signal_id instead.
signal_idID of a stored signal. Preferred over raw array.

find_spectrum_peaks

Detect peaks in a frequency spectrum. Returns a list of peaks sorted by amplitude (highest first) with frequency, amplitude, and prominence values.

ParameterTypeDescription
amplitudesAmplitude or PSD values. Use spectrum_id instead.
freq_high_hzUpper frequency bound for search
freq_low_hzLower frequency bound for search
frequencies_hzFrequency axis from spectrum/PSD. Use spectrum_id instead.
max_peaksintegerMaximum number of peaks to return
min_distance_hzMin distance between peaks in Hz
min_heightMinimum peak height
min_prominenceMinimum peak prominence
spectrum_idID of a stored spectrum (from compute_spectrum or compute_power_spectral_density). Preferred over raw arrays.

detect_broken_rotor_bars

Detect broken rotor bar faults from current spectrum. Computes the BRB fault index by measuring sidebands at (1 ± 2s)·f_s relative to the fundamental. Returns severity classification: healthy / incipient / moderate / severe.

ParameterTypeDescription
amplitudesSpectrum amplitude values. Use spectrum_id instead.
frequencies_hzSpectrum frequency axis (Hz). Use spectrum_id instead.
polesintegerNumber of poles
rotor_speed_rpmnumberRotor speed in RPM
spectrum_idID of a stored spectrum (from compute_spectrum). Preferred over raw arrays.
supply_freq_hznumberSupply frequency in Hz
tolerance_hznumberFrequency search tolerance in Hz

detect_eccentricity

Detect air-gap eccentricity faults from current spectrum. Analyses sidebands at f_s ± k·f_r for static and dynamic eccentricity. Returns severity classification.

ParameterTypeDescription
amplitudesSpectrum amplitude values. Use spectrum_id instead.
frequencies_hzSpectrum frequency axis (Hz). Use spectrum_id instead.
harmonicsintegerNumber of harmonic orders to check
polesintegerNumber of poles
rotor_speed_rpmnumberRotor speed in RPM
spectrum_idID of a stored spectrum. Preferred over raw arrays.
supply_freq_hznumberSupply frequency in Hz
tolerance_hznumberFrequency search tolerance in Hz

detect_stator_faults

Detect stator inter-turn short circuit faults from current spectrum. Analyses sidebands at f_s ± 2k·f_r caused by stator winding asymmetry.

ParameterTypeDescription
amplitudesSpectrum amplitude values. Use spectrum_id instead.
frequencies_hzSpectrum frequency axis (Hz). Use spectrum_id instead.
harmonicsintegerNumber of harmonic orders
polesintegerNumber of poles
rotor_speed_rpmnumberRotor speed in RPM
spectrum_idID of a stored spectrum. Preferred over raw arrays.
supply_freq_hznumberSupply frequency in Hz
tolerance_hznumberFrequency search tolerance in Hz

detect_bearing_faults

Detect bearing defect signatures in the stator-current spectrum. Bearing faults modulate motor torque, creating sidebands at f_s ± k·f_defect. Note: bearing signatures in current are typically weak; envelope analysis or vibration data can improve detection.

ParameterTypeDescription
amplitudesSpectrum amplitude values. Use spectrum_id instead.
bearing_defect_freq_hznumberBearing characteristic defect frequency in Hz (BPFO, BPFI, BSF, or FTF)
defect_typestringDefect type label: bpfo, bpfi, bsf, or ftf
frequencies_hzSpectrum frequency axis (Hz). Use spectrum_id instead.
harmonicsintegerNumber of sideband orders
spectrum_idID of a stored spectrum. Preferred over raw arrays.
supply_freq_hznumberSupply frequency in Hz
tolerance_hznumberFrequency search tolerance in Hz

compute_envelope_spectrum

Compute the envelope spectrum of a current signal. Uses the Hilbert transform to extract the amplitude envelope, then computes its FFT. Useful for detecting bearing and mechanical faults that modulate the current at low frequencies.

ParameterTypeDescription
bandpass_high_hzUpper bandpass cutoff before envelope (optional)
bandpass_low_hzLower bandpass cutoff before envelope (optional)
max_freq_hzMax frequency to return (Hz)
sampling_freq_hzSampling frequency in Hz. Auto-resolved when using signal_id.
signalTime-domain current signal. Use signal_id instead.
signal_idID of a stored signal. Preferred over raw array.

compute_band_energy

Compute the integrated spectral energy in a frequency band. Useful as a generic fault/cavitation indicator — measures the energy concentration around a characteristic frequency in the PSD.

ParameterTypeDescription
centre_freq_hz *numberCentre of the frequency band (Hz)
bandwidth_hznumberTotal bandwidth for energy integration (Hz)
frequencies_hzPSD frequency axis (Hz). Use spectrum_id instead.
psd_valuesPSD values. Use spectrum_id instead.
spectrum_idID of a stored PSD spectrum. Preferred over raw arrays.

compute_time_frequency

Compute Short-Time Fourier Transform (STFT) for time-frequency analysis. For non-stationary conditions (variable speed/load, start-up transients). If target_freq_hz is provided, also tracks that frequency's amplitude over time. Returns a summary (not the full 2D matrix) to keep output manageable.

ParameterTypeDescription
npersegintegerWindow length per segment (samples)
sampling_freq_hzSampling frequency in Hz. Auto-resolved when using signal_id.
signalTime-domain current signal. Use signal_id instead.
signal_idID of a stored signal. Preferred over raw array.
target_freq_hzFrequency to track over time (Hz). If provided, returns amplitude vs time for that frequency
tolerance_hznumberTolerance for frequency tracking (Hz)

inspect_signal_file

Inspect a signal file without fully loading it. Returns file metadata: size, format details, estimated number of samples, sampling frequency (for WAV), column headers (for CSV), and array shape (for NPY). Use this before load_signal_from_file to verify the file format and plan the loading parameters.

ParameterTypeDescription
file_path *stringAbsolute path to the signal file (CSV, WAV, or NPY)

load_signal_from_file

Load a motor-current signal from a file (CSV, WAV, or NumPy NPY). Supports the most common formats used by industrial DAQ systems: - **CSV/TSV/TXT**: Columnar data with optional time column. The sampling frequency is inferred from the time column or must be provided explicitly. - **WAV**: Audio files from portable recorders or DAQ. Sampling frequency is read from the WAV header. - **NPY**: NumPy binary arrays. Sampling frequency must be provided. Returns the signal, sampling frequency, number of samples, duration, and file metadata. The returned sig…

ParameterTypeDescription
file_path *stringAbsolute path to the signal file (CSV, WAV, or NPY)
channelintegerWAV channel index (0-based) for multi-channel files
delimiterCSV delimiter. Auto-detected if null (comma for .csv, tab for .tsv/.txt)
max_rowsMax data rows to read from CSV (null = all)
sampling_freq_hzSampling frequency in Hz. Required for NPY; optional for CSV if a time column exists; auto-detected for WAV
signal_columnCSV column containing the current signal (0-based index or header name)
skip_headerintegerNumber of CSV header rows to skip
time_columnCSV column for time (index or name). Set to null if no time column

generate_test_current_signal

Generate a synthetic motor-current test signal. Creates a simulated stator-current waveform with the fundamental, supply harmonics, noise, and optional fault signatures. Useful for testing, validation, and demonstration of MCSA analysis tools.

ParameterTypeDescription
duration_snumberSignal duration in seconds
fault_severitynumberFault component amplitude (0-1 relative)
faultsFaults to inject: 'brb', 'eccentricity', 'bearing'. Omit for healthy signal
noise_levelnumberNoise standard deviation (0-1 relative)
polesintegerNumber of poles
rotor_speed_rpmnumberRotor speed in RPM
sampling_freq_hznumberSampling frequency in Hz
supply_freq_hznumberSupply frequency in Hz

run_full_diagnosis

Run a comprehensive MCSA diagnostic analysis on a current signal. Performs the full pipeline: preprocessing → spectrum → fault detection for broken rotor bars, eccentricity, stator faults, and optionally bearing defects. Returns a complete diagnostic report.

ParameterTypeDescription
bearing_defect_freq_hzBearing defect frequency in Hz (optional, for bearing analysis)
polesintegerNumber of poles
rotor_speed_rpmnumberRotor speed in RPM
sampling_freq_hzSampling frequency in Hz. Auto-resolved when using signal_id.
signalRaw time-domain current signal. Use signal_id instead for large signals.
signal_idID of a stored signal (from generate_test_current_signal or load_signal_from_file). Preferred over raw array.
supply_freq_hznumberSupply frequency in Hz
tolerance_hznumberFrequency search tolerance in Hz

diagnose_from_file

Load a signal from file and run the full MCSA diagnostic pipeline. One-shot tool: reads the signal file, preprocesses, computes the spectrum, runs all fault detectors, and returns a complete diagnostic report. Ideal for batch or automated condition-monitoring workflows.

ParameterTypeDescription
file_path *stringAbsolute path to the signal file (CSV, WAV, or NPY)
poles *integerNumber of poles
rotor_speed_rpm *numberRotor speed in RPM
supply_freq_hz *numberSupply frequency in Hz
bearing_defect_freq_hzBearing defect frequency in Hz (optional)
channelintegerWAV channel index
sampling_freq_hzSampling frequency in Hz (required for NPY, optional for CSV with time column, auto-detected for WAV)
signal_columnCSV column for the current signal
time_columnCSV column for time (null if absent)
tolerance_hznumberFrequency search tolerance in Hz

list_stored_data

List all signals and spectra currently stored on disk. Returns a compact summary of each stored item (ID, type, size, and key metadata) without returning the raw data arrays. The data is persisted in the MCSA data directory and survives server restarts.

clear_stored_data

Delete stored signals and spectra from disk and memory. Pass a specific data_id to remove one item, or omit to clear all.

ParameterTypeDescription
data_idID of a specific item to remove, or omit to clear everything