メインコンテンツ

診断特徴デザイナーでの MATLAB 関数の生成

診断特徴デザイナーでは、信号処理、特徴生成、およびランク付けのためのツールを使用して、特徴を対話的に調査します。最適な特徴セットを選択したら、それらの特徴の計算を再現する MATLAB® 関数を生成できます。この関数を、より大規模な測定データセットに直接適用して、特徴セットのメンバー数を増やすことができます。また、用途に合わせて関数を変更したり、関数の一部または全部を他のコードに組み込むことができます。

この例では、MATLAB 関数を生成して特徴セットを計算し、元のデータセットを使用してその関数を検証する方法を説明します。

この例では、アンサンブル データの概念およびアプリでの基本的な操作 (データのインポート、信号処理、特徴の生成など) に精通していることを前提としています。これらの概念と操作の詳細については、予知保全アルゴリズムの状態インジケーターの設計を参照してください。

トランスミッション モデル データのインポート

この例では、Simulink を使用した故障データの生成のトランスミッション システム モデルから生成されたアンサンブル データを使用します。モデルの出力には以下のものが含まれます。

  • ケーシングの振動を監視するセンサーからの振動測定

  • シャフトが 1 回転するたびにパルスを発するタコメーター センサー

  • モデル化された故障の存在を示す故障コード

MATLAB コマンド ウィンドウで、table dataTable に格納されているトランスミッション データを読み込みます。

load dfd_Tutorial dataTable
dataTable は、16 個のメンバーが含まれるアンサンブル table です。各メンバーはシミュレートされた 1 つのトランスミッション システムを表します。table の各行は 1 つのメンバーに対応します。table の各列は、VibrationFaultCode など、1 つの変数に対応します。すべてのアンサンブル メンバーは同じ変数をもちます。

診断特徴デザイナーを開きます。

diagnosticFeatureDesigner

アプリで dataTable をインポートします。インポート処理の際、faultCode のタイプを状態変数に設定します。インポートが完了すると、[変数] ペインの [信号] リストに振動データおよびタコメーター データが表示されます。インポート処理の詳細については、診断特徴デザイナーでのアンサンブル データのインポートと可視化を参照してください。

dataTable is selected in the Dataset selection menu on the left. The Variables pane on the right shows the imported variables.

TSA 信号の計算

振動信号およびタコメーター信号から時間同期平均化 (TSA) 信号を計算します。そのためにはまず、[変数] ペインで Vibration/Data を選択します。次に、[特徴デザイナー] タブで [フィルター処理と平均化][時間同期平均化] を選択します。パラメーターを次の図に示すように設定して [OK] をクリックします。

The Time-Synchronous Averaging tab is on the top. The Variables pane is on the bottom.

アプリの [変数] ペインに新しい信号が表示されます。

In the Variables pane, the new signal, Vibration_tsa, is the third signal on the list.

TSA 信号の詳細については、tsa を参照してください。

TSA 信号からの特徴抽出

[変数] ペインで、TSA 信号を選択します。次に、[特徴デザイナー] タブで、[時間領域の特徴][信号の特徴] を選択して、使用可能な信号特徴のセットを開きます。[平均][標準偏差]、および [尖度] の特徴を選択します。

The Signal Features tab is on the top. The Statistical Features section, which is the first feature-selection section of the tab, includes the selected features. The Variables pane on the bottom shows that Vibration_tsa is selected.

特徴値を表示します。[変数] ペインで、[FeatureTable1] を選択します。次に、プロット ギャラリーで、[特徴テーブル ビュー] をクリックします。これらの手順により、状態変数 faultCode と共に、各メンバーの特徴値が含まれる table が開きます。

Feature value review. In the Variables pane on the left, FeatureTable1 is selected. In the Plot gallery on the right, Feature Table View is the middle plot option. The feature values are on the bottom.

MATLAB 関数の生成

これらの特徴の計算を再現する MATLAB 関数を生成します。[特徴デザイナー] タブで、[エクスポート][特徴の関数の生成] を選択します。

Export Features options. On the top, The Export button is on the far right. Underneath the button is a menu that contains options for Data and Code exports. In the Code section of the menu, Generate Function for Features is the first option and is selected.

選択すると、特徴テーブルと特徴を指定できるダイアログ ボックスが開きます。ランク付けを実行していないため、アプリによって、3 つの関数をすべてエクスポートするようにダイアログ ボックスが構成されます。

Generate Function for Features dialog box. The top option is "Feature Table", which is set to FeatureTable1. The middle option is "Features sorted by", and is set to "None". The third option, "Number of Top Features", is disabled. Underneath the options are Help, OK, and Cancel buttons.

[OK] をクリックすると、次の行から始まる MATLAB エディターで関数スクリプトが開きます。

function [featureTable,outputTable] = diagnosticFeatures(inputData)
%DIAGNOSTICFEATURES recreates results in Diagnostic Feature Designer.
%
% Input:
%  inputData: A table or a cell array of tables/matrices containing the
%  data as those imported into the app.
%
% Output:
%  featureTable: A table containing all features and condition variables.
%  outputTable: A table containing the computation results.
%
% This function computes signals:
%  Vibration_tsa/Data
%
% This function computes features:
%  Vibration_tsa_sigstats/Kurtosis
%  Vibration_tsa_sigstats/Mean
%  Vibration_tsa_sigstats/Std
%
% Organization of the function:
% 1. Compute signals/spectra/features
% 2. Extract computed features into a table
%
% Modify the function to add or remove data processing, feature generation
% or ranking operations.
プリアンブルでは、何を計算する関数であるかが説明されます。この場合、関数は特徴を計算すると共に、これらの特徴の信号ソースを生成した TSA 処理も行います。スクリプトを diagnosticFeatures.m として保存します。

コード内容の詳細については、アプリで生成された MATLAB コードの構造を参照してください。

元のデータを使用した関数の検証

dataTable を使用して関数を実行し、新しい特徴テーブル featuretable を作成します。

featuretable = diagnosticFeatures(dataTable)

アプリで、最初の 8 個の特徴値について、対応する特徴値と比較します。表示された精度のレベルでは、値は同一です。

  16×4 table

    faultCode    Vibration_tsa_stats/Kurtosis    Vibration_tsa_stats/Mean    Vibration_tsa_stats/Std
    _________    ____________________________    ________________________    _______________________

        0                   2.2516                       0.022125                    0.99955        
        1                   2.2526                      -0.027311                      0.999        
        1                   2.2571                       -0.45475                    0.99629        
        1                   2.2526                        0.47419                      0.999        
        1                   2.2529                        0.37326                      0.999        
        1                   2.2526                       -0.14185                      0.999        
        1                   2.2529                        0.40644                      0.999        
        1                   2.2529                       -0.47485                    0.99915
       

参考

| | | | |

トピック