Bearing data processing of Western Reserve University -- with MATLAB code

There are already many, many articles about the data introduction of Western Reserve University. This article aims to use matlab language to realize the data processing of Western Reserve University, from the original data directly to the data that can be directly used by everyone for fault identification.

9469c8834fd94fa0bc3c886924142009.png

First, attach a picture of the introduction of the Western Reserve University data set. From the picture, we can see which fault type each data of Western Reserve University corresponds to. Generally, when performing fault diagnosis, it is used to diagnose the data at the same speed. For example,
105.mat is an inner race failure at a diameter of 0.007 inches and a speed of 1797
118.mat is a rolling element failure of a diameter of 0.007 inches
and a speed of 1797 130.mat is a failure of an outer race at a diameter of 0.007 and a speed of 1797
169. mat is inner race fault at 0.014 inch diameter at 1797 rpm
185.mat is rolling element fault at 0.014
inch diameter at 1797 rpm 197.mat is outer race fault at 0.014 inch diameter at
1797 rpm 209.mat is 0.021 inch diameter inner race failure at 1797 rpm
222.mat is rolling element failure 0.021 inch diameter at 1797 rpm
234.mat is outer race failure 0.021 inch diameter at 1797 rpm

Therefore, when diagnosing, it is customary to put these types of data together and send them into the machine learning model for identification.

Tell me about the processing steps in this article:

  1. Load a total of 10 kinds of data, and then take the DE_time of each data (%DE is the drive end data, FE is the fan end data, BA is the acceleration data, just choose one of them)
  2. Set the sliding window w, the number of fault sample points s for each data, and the sample size m for each fault type
  3. After all the data sliding window is completed, it is integrated into a data variable
  4. Label the data for each fault category.

The result of the program will output an excel with a label and an excel without a label. When you write the program, you can also use the save command to store the data variable for future use!

 Show everyone the result graph.

4f997a1bb1c14ad7938a0b3a961c1532.png

Labeled data collation: Here, the first column is set as a label, and there are s+1 columns in total

4fa6fa23cbc94259a8bd31f5e9da2e24.png

 Data collation without labels: a total of s columns

1b609327a4d04f1b8a6c19b934109977.png

 code show as below:

clc;
clear;
addpath(genpath(pwd));
%DE是驱动端数据 FE是风扇端数据 BA是加速度数据 选择其中一个就行
load 97.mat  %正常
load 105.mat  %直径0.007英寸,转速为1797时的  内圈故障
load 118.mat   %直径0.007,转速为1797时的  滚动体故障
load 130.mat  %直径0.007,转速为1797时的  外圈故障
load 169.mat   %直径0.014英寸,转速为1797时的  内圈故障
load 185.mat    %直径0.014英寸,转速为1797时的  滚动体故障
load 197.mat    %直径0.014英寸,转速为1797时的  外圈故障
load 209.mat   %直径0.021英寸,转速为1797时的  内圈故障
load 222.mat  %直径0.021英寸,转速为1797时的  滚动体故障
load 234.mat  %直径0.021英寸,转速为1797时的 外圈故障
% 一共是10个状态,每个状态有120组样本,每个样本的数据量大小为:1×2048
w=1000;                  % w是滑动窗口的大小1000
s=2048;                  % 每个故障表示有2048个故障点
m = 120;            %每种故障有120个样本
D0=[];
for i =1:m
    D0 = [D0,X097_DE_time(1+w*(i-1):w*(i-1)+s)];
end
D0 = D0';
D1=[];
for i =1:m
    D1 = [D1,X105_DE_time(1+w*(i-1):w*(i-1)+s)];
end
D1 = D1';

D2=[];
for i =1:m
    D2 = [D2,X118_DE_time(1+w*(i-1):w*(i-1)+s)];
end
D2 = D2';
D3=[];
for i =1:m
    D3 = [D3,X130_DE_time(1+w*(i-1):w*(i-1)+s)];
end
D3 = D3';
D4=[];
for i =1:m
    D4 = [D4,X169_DE_time(1+w*(i-1):w*(i-1)+s)];
end
D4 = D4';
D5=[];
for i =1:m
    D5 = [D5,X185_DE_time(1+w*(i-1):w*(i-1)+s)];
end
D5 = D5';
D6=[];
for i =1:m
    D6 = [D6,X197_DE_time(1+w*(i-1):w*(i-1)+s)];
end
D6 = D6';
D7=[];
for i =1:m
    D7 = [D7,X209_DE_time(1+w*(i-1):w*(i-1)+s)];
end
D7 = D7';
D8=[];
for i =1:m
    D8 = [D8,X222_DE_time(1+w*(i-1):w*(i-1)+s)];
end
D8 = D8';
D9=[];
for i =1:m
    D9 = [D9,X234_DE_time(1+w*(i-1):w*(i-1)+s)];
end
D9 = D9';
data = [D0;D1;D2;D3;D4;D5;D6;D7;D8;D9];
ceshi_data = data;
save data data
folder='测试数据汇总/'; %%定义变量
if exist(folder)==0 %%判断文件夹是否存在
    mkdir(folder);  %%不存在时候,创建文件夹
end

xlswrite('/测试数据汇总/转速1797_测试数据汇总.xlsx',ceshi_data);

dd = [];
for i = 0:size(data,1)/m-1
    dd(1+m*i:m+m*i) = i+1;
end
zj = [dd;data'];
ceshi_data = zj';
xlswrite('/测试数据汇总/转速1797_测试数据汇总带标签.xlsx',ceshi_data);
rmpath(genpath(pwd))

How to organize the code and data, the small card below. Key words: Western Reserve University , choose one to reply.

Welcome everyone to leave a message in the comment area, what type of code is needed, please tell the blogger!

おすすめ

転載: blog.csdn.net/woaipythonmeme/article/details/131214489