analyze and select features for pump diagnostics -凯发k8网页登录
this example shows how to use the diagnostic feature designer app to analyze and select features to diagnose faults in a triplex reciprocating pump.
the example uses simulated pump fault data generated by the example. the data has been preprocessed to remove the pump startup transients.
open diagnostic feature designer
load the triplex pump fault data. the pump data contains 240 flow and pressure measurements for different fault conditions. there are three fault types (leaking pump cylinder, blocked pump inlet, increased pump bearing friction). the measurements cover conditions where none, one, or multiple faults are present. the data is collected in a table where each row is a different measurement.
load('savedpumpdata')
pumpdata
pumpdata=240×3 table
flow pressure faultcode
__________________ __________________ _________
{1201x1 timetable} {1201x1 timetable} 0
{1201x1 timetable} {1201x1 timetable} 0
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 0
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
{1201x1 timetable} {1201x1 timetable} 100
⋮
open diagnostic feature designer by using the diagnosticfeaturedesigner
command. initiate a new session by clicking new session, which opens a dialog box for importing data.
in the select dataset from workspace pane, select pumpdata
as your data source. in the select source variables pane, confirm that the variable names match those that you viewed at the command line. flow
and pressure
are both signals. faultcode
is a condition variable. condition variables denote the presence or absence of a fault and are used by the app for grouping and classification. when you first open the new session dialog box, the app displays the variable properties for the first variable.
click import to import the pump data into the app.
plot data and group by fault code
plot the flow signal by selecting flow
from the variables section of the data browser and clicking signal trace in the plot gallery. plot the pressure
signal the same way.
these plots show the pressure and flow signals for all 240 members in the dataset. you can click the signal trace tab and select group by faultcode
to display signals with the same fault code in the same color. grouping signals in this way can help you to quickly determine if there are any clear differences between signals of different fault types. in this case, the measured signals do not show any clear differences for different fault codes.
to group all future plots by faultcode
, use plot options. clicking plot options opens a dialog box that lets you set preferences for the session.
extract time domain features
as the measured signals do not show any differences for different fault conditions, the next step is to extract time-domain features such as signal mean and standard deviation from the signal. first, select flow/data
in the data browser. then, select time-domain features and then signal features.
two new tabs open, signal features and time-domain features. in signal features, select the features you would like to extract and click apply. for now, clear the plot results check box. you will plot results later to see if the features help distinguish different fault conditions. repeat this process for the pressure signal.
extract frequency domain features
a reciprocating pump uses a drive shaft and cylinders to pump fluid. because of the mechanical construction of the pump, there are likely to be cyclic fluctuations in the pump flow and pressure. for example, zoom into a section of the flow signals using the signal panner below the signal trace plot.
computing the frequency spectrum of the flow will highlight the cyclic nature of the flow signal and could give better insight into how the flow signal changes under different fault conditions. estimate the frequency spectra using an autoregressive model.
this method fits an autoregressive model of the prescribed order to the data, and then computes the spectrum of that estimated model. this approach reduces any overfitting to the raw data signal. in this case specify a model order of 20
. also set the frequency grid to have a minimum of 0
and a maximum of 500
.
plotting the computed spectra on a linear scale clearly shows resonant peaks. grouping by fault code highlights how the spectra change for different fault conditions.
perform the same computations for the pressure signal as the results will provide additional features to help distinguish different fault conditions.
you can now compute spectral features such as peaks, modal coefficients, and band power.
extract these features in a smaller band of frequencies between 23-250 hz as the peaks after 250 hz are smaller. for each signal, extract five spectral peaks. for now, clear the plot results check box. you will plot results later to see if the features help distinguish different fault conditions. repeat this process for the pressure signal by changing the signal selected at the top of the dialog box.
view features
all the features we have extracted have been collected in a table shown in the feature tables browser. to view the computed feature data, select featuretable1
from the data browser and click feature table view in the plot gallery. the fault code is also displayed in the feature table view as the rightmost column in the table. as more features are computed, more columns get appended to the table.
you can see the distributions of the feature values for different condition variable values, in this case, fault types, by viewing the feature table as a histogram. select featuretable1
and then, click histogram in the plot gallery to create a set of histogram plots. use the next and previous buttons to show histograms for different features. histogram plots grouped by fault code can help to determine if certain features are strong differentiators between fault types. if they are strong differentiators, their distributions will be more distant from each other. for the triplex pump data, the feature distributions tend to overlap and there are no features that can clearly be used to identify faults. the next section looks at using automated ranking to find which features are more useful for fault prediction.
rank and export features
from the feature designer tab, click rank features and select featuretable1
. the app gathers all the feature data and ranks the features based on a metric such as anova. the app lists the features in order of importance based on the metric value. in this case, the rms value for the flow signal and the rms and mean values for the pressure signal are the features that most strongly distinguish different fault types from each other.
after you have ranked your features in terms of importance, the next step is to export them so that you can train a classification model based on these features. click export, select export features to classification learner, and select the features you want to use for classification. in this case, export the top 15 features. the app then sends these features to classification learner where they can be used to design a classifier to identify different faults.
in the new session from file dialog box that classification learner opens, confirm 5-fold cross-validation and start the session.
classification learner displays a scatter plot for a single model.
in the models section of the classification learner tab, select all model types for training.
in the models list, select multiple. then, click train all.
when the training is complete, classification learner lists each model in order of model number, along with the model validation accuracy, and displays a confusion matrix for the first model in the set. change the sort by order to accuracy (validation)
.
the svm method has the highest classification accuracy of around 77%. there is some randomness in the process, so your results may be different. select this model and click confusion matrix. the confusion matrix illustrates how well this method classifies models for each fault type. the entries on the diagonal represent the number of fault types that are correctly classified. off-diagonal entries represent fault types for which the predicted and true classes are not the same. to improve accuracy, you can try increasing the number of features. alternatively, you can iterate on the existing features. another step would be to iterate on the existing features— especially the spectral features — and perhaps to modify the spectral computation method, change the bandwidth, or use different frequency peaks to improve the classification accuracy.
diagnose triplex pump faults
this example showed how to use diagnostic feature designer to analyze and select features and create a classifier to diagnose faults in a triplex reciprocating pump.
see also
diagnostic feature designer | classification learner