必須可以的,給你一個(gè)簡(jiǎn)單的例子
做多了基于機(jī)器學(xué)習(xí)和深度學(xué)習(xí)的機(jī)械故障診斷,感覺沒意思了,換個(gè)口味,寫一下基于現(xiàn)代信號(hào)處理的齒輪故障檢測(cè)。本例來(lái)源于Mathworks公司的某一個(gè)大佬,主要講解如何利用電機(jī)的電流信號(hào)識(shí)別齒輪系中的故障。
運(yùn)行環(huán)境:MATLAB R2021B,低于此版本可能不能運(yùn)行成功
使用傳統(tǒng)振動(dòng)傳感器進(jìn)行齒輪的故障監(jiān)測(cè)具有一定的挑戰(zhàn)性,尤其是當(dāng)振動(dòng)傳感器不易安裝時(shí)。由于電流信號(hào)很容易獲取,因此本例說明如何應(yīng)用電機(jī)電流特征分析提取頻譜特征,以檢測(cè)電機(jī)驅(qū)動(dòng)齒輪中的故障。
硬件
本例中的電流數(shù)據(jù)是Futaba S3003伺服器中采集的,該伺服器經(jīng)過修改可以實(shí)現(xiàn)連續(xù)旋轉(zhuǎn)。伺服系統(tǒng)將內(nèi)部直流電機(jī)的高轉(zhuǎn)速轉(zhuǎn)換為輸出的高扭矩。伺服系統(tǒng)由直流電機(jī)、一組尼龍金屬齒輪和控制電路組成。本例移除了控制電路,允許直接監(jiān)控直流電機(jī)的電流信號(hào),使用紅外光斷續(xù)器采集伺服器輸出的轉(zhuǎn)速信號(hào)。伺服器和紅外光斷續(xù)器由3D 打印支架固定。
直流電機(jī)以恒定5伏電壓驅(qū)動(dòng),四對(duì)齒輪提供 278:1 的減速比,花鍵處的軸轉(zhuǎn)速約為 50 rpm。 由于電流測(cè)量值的變化太小而無(wú)法檢測(cè),因此使用單電源傳感器接口放大器放大了電流信號(hào)。 然后使用抗混疊五階橢圓低通濾波器對(duì)放大的電流信號(hào)進(jìn)行濾波,使其平滑并消除噪聲,然后通過模數(shù)轉(zhuǎn)換器 (ADC) 將其發(fā)送到 Arduino Uno。
如上面流程圖所示,首先分別使用放大器和抗混疊低通濾波器對(duì)電流信號(hào)進(jìn)行放大和濾波。 Arduino Uno 通過 ADC 以 1.5 kHz 采樣電流信號(hào),并將其與轉(zhuǎn)速計(jì)脈沖一起作為串行數(shù)據(jù)以 115200 的波特率傳輸?shù)接?jì)算機(jī)。MATLAB 腳本從 Arduino Uno 獲取串行數(shù)據(jù)并將其寫入逗號(hào)分隔值 (CSV) 文件。 然后使用 MATLAB 讀取和處理CSV 文件以提取頻譜指標(biāo)。
伺服齒輪系
Futaba S3003 由四對(duì)尼龍齒輪組成,如上圖所示。 直流電機(jī)軸上的小齒輪 P1 與階梯齒輪 G1 嚙合,小齒輪P2與階梯齒輪G2嚙合,小齒輪P3與階梯齒輪G3嚙合,小齒輪 P4 與連接到輸出花鍵的齒輪 G4 嚙合。 階梯式齒輪組 G1 和 P2、G2 和 P3 以及 G3 和 P4 是自由旋轉(zhuǎn)齒輪,即它們不連接到各自的軸上。 當(dāng)電機(jī)以 5 伏電壓驅(qū)動(dòng)時(shí),該組驅(qū)動(dòng)齒輪提供了 278:1 的減速比,從 13901 rpm 的電機(jī)速度到輸出花鍵的50 rpm轉(zhuǎn)速。 下表概述了每個(gè)齒輪嚙合處的輸出速度、齒輪嚙合頻率和累積齒輪減速的齒數(shù)和理論值。
在將故障引入階梯齒輪 G2 和 G3 之前,共收集了 10 個(gè)健康數(shù)據(jù)集。 由于齒輪是用尼龍模制而成的,因此在齒空間中切割槽,在兩個(gè)齒輪中引入了模擬裂紋。 齒距是沿正齒輪的節(jié)圓測(cè)量的兩個(gè)相鄰齒之間的間隙。 槽深度約為齒輪半徑的 70%。 引入齒輪G2和G3的故障后,共記錄了10個(gè)故障數(shù)據(jù)集。
數(shù)據(jù)可視化
考慮一組健康和故障數(shù)據(jù),可視化當(dāng)前信號(hào)和轉(zhuǎn)速脈沖
healthyData = servoData.healthyData{1,1};
faultyData = servoData.faultyData{1,1};
healthyCurrent = healthyData.Signal;
faultyCurrent = faultyData.Signal;
healthyTacho = healthyData.Pulse;
faultyTacho = faultyData.Pulse;
tHealthy = healthyData.Time;
tFaulty = faultyData.Time;
figure
ax1 = subplot(221);
plot(tHealthy,healthyCurrent)
title(Current Signal - Healthy Gears)
ylabel(Current (mA))
ax2 = subplot(222);
plot(tFaulty,faultyCurrent)
title(Current Signal - Faulty Gears)
ylabel(Current (mA))
ax3 = subplot(223);
plot(tHealthy,healthyTacho)
title(Tachometer Pulse - Healthy Gears)
ylabel(Pulses, 8/rev)
ax4 = subplot(224);
plot(tFaulty,faultyTacho)
title(Tachometer Pulse - Faulty Gears)
ylabel(Pulses, 8/rev)
linkaxes([ax1,ax2,ax3,ax4],x);
ax1.XLim = seconds([0 2]);
輸出花鍵每轉(zhuǎn)八個(gè)脈沖,對(duì)應(yīng)于伺服輪上的八個(gè)孔。
計(jì)算額定轉(zhuǎn)速
計(jì)算額定速度,以檢測(cè)齒輪系統(tǒng)中感興趣的頻率,并將其與功率譜上的頻率正確匹配,感興趣的頻率是以Hz為單位的實(shí)際輸出速度值。使用1500Hz的采樣頻率值,可視化轉(zhuǎn)速計(jì)信號(hào),并使用tachorpm函數(shù)計(jì)算額定轉(zhuǎn)速。
fs = 1500;
figure
tachorpm(healthyTacho,fs,PulsesPerRev,8)
figure
tachorpm(faultyTacho,fs,PulsesPerRev,8)
rpmHealthy = mean(tachorpm(healthyTacho,fs,PulsesPerRev,8))
rpmFaulty = mean(tachorpm(faultyTacho,fs,PulsesPerRev,8))
rpmHealthy = 49.8550
rpmFaulty = 49.5267
在正常數(shù)據(jù)集和故障數(shù)據(jù)集之間,輸出軸速度有非常小的差異。實(shí)際額定rpm值也接近理論值50 rpm。
構(gòu)造頻帶
構(gòu)造頻帶是計(jì)算頻譜指標(biāo)的重要前提。利用齒輪系中驅(qū)動(dòng)齒輪的齒數(shù)和名義轉(zhuǎn)數(shù),首先計(jì)算感興趣的頻率,感興趣的頻率是以Hz為單位的實(shí)際輸出速度值,其值接近下表中列出的理論值。
%齒數(shù)
G4 = 41; G3 = 35; G2 = 50; G1 = 62;
P4 = 16; P3 = 10; P2 = 10; P1 = 10;
rpm = rpmHealthy;
%感興趣的頻率
FS5 = mean(rpm)/60;
FS4 = G4/P4*FS5;
FS3 = G3/P3*FS4;
FS2 = G2/P2*FS3;
FS1 = G1/P1*FS2;
FS = [FS1,FS2,FS3,FS4,FS5]
接下來(lái),使用faultBands函數(shù)構(gòu)造所有輸出速度的頻帶,其中包括以下感興趣的頻率。
FS1 at 231 Hz, its first two harmonics, and 0:1 sidebands of FS2
FS2 at 37.3 Hz, its first two harmonics, and 0:1 sidebands of FS3
FS3 at 7.5 Hz and its first two harmonics
FS4 at 2.1 Hz and its first two harmonics
[FB1,info1] = faultBands(FS1,1:2,FS2,0:1);
[FB2,info2] = faultBands(FS2,1:2,FS3,0:1);
[FB3,info3] = faultBands(FS3,1:2);
[FB4,info4] = faultBands(FS4,1:2);
FB = [FB1;FB2;FB3;FB4]
輸出FB是一個(gè)16 × 2的數(shù)組,包含以上感興趣的頻率。
提取功率譜密度(PSD)數(shù)據(jù)
計(jì)算并可視化運(yùn)行正常和故障數(shù)據(jù)的功率譜,利用結(jié)構(gòu)信息中的信息在頻譜圖上繪制感興趣的頻率,并放大部分頻率
藍(lán)色表示正常頻譜,紅色表示故障數(shù)據(jù)頻譜。從圖中可以觀察到故障頻率振幅的增加:
1FS1 at 231 Hz, its second harmonic 2FS1 at 462 Hz, and their respective sidebands
放大圖,觀察以下頻率的振幅增加情況:
1FS2 at 37.2 Hz and its sidebands
1FS3 at 7.5 Hz and its second harmonic 2FS3 at 15 Hz
1FS4 at 2.1 Hz and its second harmonic 2FS4 at 4.2 Hz
利用pspectrum函數(shù)分別計(jì)算健康信號(hào)和故障信號(hào)的PSD
[psdHealthy,fHealthy] = pspectrum(healthyCurrent,fs,FrequencyResolution,0.5);
[psdFaulty,fFaulty] =
pspectrum(faultyCurrent,fs,FrequencyResolution,0.5);
計(jì)算頻譜指標(biāo)
使用頻帶數(shù)據(jù)和PSD數(shù)據(jù),使用faultBandMetrics函數(shù)計(jì)算健康數(shù)據(jù)和故障數(shù)據(jù)的頻譜指標(biāo)
spectralMetrics = faultBandMetrics({[psdHealthy,fHealthy],[psdFaulty,fFaulty]},FB)
spectralMetrics=2×49 table
PeakAmplitude1 PeakFrequency1 BandPower1 PeakAmplitude2 PeakFrequency2 BandPower2 PeakAmplitude3 PeakFrequency3 BandPower3 PeakAmplitude4 PeakFrequency4 BandPower4 PeakAmplitude5 PeakFrequency5 BandPower5 PeakAmplitude6 PeakFrequency6 BandPower6 PeakAmplitude7 PeakFrequency7 BandPower7 PeakAmplitude8 PeakFrequency8 BandPower8 PeakAmplitude9 PeakFrequency9 BandPower9 PeakAmplitude10 PeakFrequency10 BandPower10 PeakAmplitude11 PeakFrequency11 BandPower11 PeakAmplitude12 PeakFrequency12 BandPower12 PeakAmplitude13 PeakFrequency13 BandPower13 PeakAmplitude14 PeakFrequency14 BandPower14 PeakAmplitude15 PeakFrequency15 BandPower15 PeakAmplitude16 PeakFrequency16 BandPower16 TotalBandPower
______________ ______________ __________ ______________ ______________ __________ ______________ ______________ __________ ______________ ______________ __________ ______________ ______________ __________ ______________ ______________ __________ ______________ ______________ __________ ______________ ______________ __________ ______________ ______________ __________ _______________ _______________ ___________ _______________ _______________ ___________ _______________ _______________ ___________ _______________ _______________ ___________ _______________ _______________ ___________ _______________ _______________ ___________ _______________ _______________ ___________ ______________
0.0020712 193.75 0.010881 0.50813 231.06 0.46652 0.0019579 272.5 0.011841 0.0020486 424.06 0.011225 0.54982 462 0.89544 0.0024293 493.69 0.0091045 0.002966 29.812 0.0035485 0.015582 37.25 0.011132 0.0028865 44.688 0.0041317 0.011896 67.062 0.0072753 0.059126 74.5 0.033568 0.013218 82 0.0079886 5.7904 7.4375 2.3115 0.068452 14.938 0.027653 0.79006 2.125 0.14382 0.09849 4.25 0.01806 3.9737
0.009804 192.44 0.017916 3.6921 229.44 2.9975 0.0035204 266.44 0.015639 0.0057056 421.75 0.019293 1.2974 459.69 3.2185 0.0053261 495.88 0.016296 0.0031674 28.938 0.0044271 0.023983 37 0.014447 0.0136 44.438 0.0089119 0.011419 66.625 0.0077035 0.0684 74 0.037016 0.012244 81.438 0.0075805 7.7931 7.375 3.0193 0.15692 14.812 0.058255 2.4211 2.125 0.4407 0.55167 4.25 0.10029 9.9838
輸出是FB中頻率范圍的一個(gè)2 × 49的指標(biāo)表。第一行包含健康數(shù)據(jù)的指標(biāo),第二行包含故障數(shù)據(jù)的指標(biāo)。注意,以下指標(biāo)對(duì)于故障數(shù)據(jù)的值要比健康數(shù)據(jù)的值高得多:
PeakAmplitude2 for the frequency at 231 Hz with a difference of 3.1842 units
TotalBandPower with a difference of 6.01 units
因此,可以使用這兩個(gè)指標(biāo)創(chuàng)建散點(diǎn)圖,分別對(duì)故障數(shù)據(jù)和健康數(shù)據(jù)進(jìn)行分組。
創(chuàng)建散點(diǎn)圖
創(chuàng)建散點(diǎn)圖,使用表servoData中的所有20個(gè)數(shù)據(jù)集的兩個(gè)譜指標(biāo)PeakAmplitude2和TotalBandPower對(duì)健康數(shù)據(jù)和故障數(shù)據(jù)進(jìn)行分類。
plotData = zeros(10,4);
for n = 1:max(size(servoData))
hC = servoData.healthyData{n,1}.Signal;
fC = servoData.faultyData{n,1}.Signal;
[psdH,freqH] = pspectrum(hC,fs,FrequencyResolution,0.5);
[psdF,freqF] = pspectrum(fC,fs,FrequencyResolution,0.5);
sMetrics = faultBandMetrics({[psdH,freqH],[psdF,freqF]},FB);
plotData(n,:) = [sMetrics{:,4},sMetrics{:,49}];
end
figure
scatter(plotData(:,1),plotData(:,3),[],blue)
hold on;
scatter(plotData(:,2),plotData(:,4),[],red)
legend(Healthy Data,Faulty Data,Location,best)
xlabel(Peak Amplitude 2)
ylabel(Total Band Power)
hold off
觀察健康數(shù)據(jù)集和故障數(shù)據(jù)集被分組在散點(diǎn)圖的不同區(qū)域。因此,通過分析伺服電機(jī)的電流特征,可以對(duì)故障和健康數(shù)據(jù)進(jìn)行分類。