4.5 Phase Calculations
4.5.1 Time Domain
The first measurement method uses the time waveform signal as shown in 4.35. The peaks of each signal and the Keyphaser are found. The time between each Keyphaser fire represents one full cycle. Then the time between a Keyphaser fire and the next positive peak for each signal are found.
The ratio between these two times multiplied by the angle for a full cycle calculates the absolute phase of the signal.
T imek∅−>SigP eak
T imek∅n−>k∅n+1
= φabsolute(rad)
2π(rad) (4.15)
The following Matlab code in figures 4.36 and 4.37 show the methods for calculating the phase in the time domain signal.
1 %Phase Calculations in time domain
2 %find the location of peaks in the window for each transducer
3 [¬, locy] = findpeaks(y, 'MinPeakProminence',1e-3); 4 [¬, locx] = findpeaks(x, 'MinPeakProminence',1e-3);
5 [¬, lock] = findpeaks(-keyphaser, 'MinPeakProminence',.1);
6 %Check to ensure at least two peaks exist for each signal, if
7 %there arent two peaks phase calcs are inconclusive
8 if length(locy)<2 | | length(locx)<2 | | length(lock)<2
9 phDiff = NaN;
10 aphDiffy = NaN;
11 aphDiffx = NaN;
Figure 4.36: Matlab Code for Locating Peaks in Time Waveform for Use in Phase Calculations
First the location of the positive peaks of the x and y signals must be found. Lines 3 and 4 of figure 4.36 use the built in Matlab function of findpeaks to store the indices (locations) in the signal of the peaks. The ’MinPeakProminence’ defines the minimum prominence for a peak to be counted. This is a major issue with this method since it is highly reliant on the findpeaks function to count the 1X peaks but not include noise or other frequency peaks. This number should be changed depending on the noise in the signal if random phase measurements are recorded. However, a fundamental fault of this method is it assumes that the largest source of vibration is 1X. Other frequencies
could be filtered out by a band pass filter if it is made certain the the 1X frequency is exactly in the middle of the band pass filter pass band to avoid adding any phase shift. Otherwise the phase change due to the filter would need to be accounted for since the Keyphaser is not undergoing the same filter.
In line 5 of figure 4.36 the keyphaser data is multiplied by a negative one since the keyphaser spikes are negatively bias, this makes the spikes positive and able to be recognized by the findpeaks function. The ’MinPeakProminence’ for recognizing a Keyphaser event is a very important parameter. In most data acquisition systems this is called the hysteresis limit or hysteresis threshold. This is the threshold the signal must cross to be considered a Keyphaser event and is often configurable to account for excess noise in the system or hysteresis depending on the material the Keyphaser proximity probe is reading off of.
Lines 8 through 11 prevent phase reading from being recorded when too little data has been taken. At least two peaks or one full cycle must be present for the phase to be calculated.
1 else
2 %Calculate phase for each set of 2 peaks in each signal
3 for j = 1:min([length(locy),length(locx),length(lock)])-1 4 ph(j) = ((locy(j)-locx(j))/(lock(j+1)-lock(j)))*2*pi; 5 aphy(j) = ((locy(j)-lock(j))/(lock(j+1)-lock(j)))*2*pi; 6 aphx(j) = ((locx(j)-lock(j))/(lock(j+1)-lock(j)))*2*pi; 7 if ph(j)<0 8 ph(j)=ph(j)+(2*pi); 9 end 10 if aphy(j)<0 11 aphy(j)=aphy(j)+(2*pi); 12 end 13 if aphx(j)<0 14 aphx(j)=aphx(j)+(2*pi); 15 end 16 end
17 %Take average of all phase calculations to give one phase
18 %for this window. Positive values are a phase lag
19 phDiff = mean(ph); 20 aphDiffy = mean(aphy); 21 aphDiffx = mean(aphx);
Figure 4.37: Matlab Code for Calculating Absolute and Relative Phase from a Time Waveform Signal
For each set of peaks the absolute and relative phase will be calculated in a For loop, then the phases will be averaged to one value. Lines 4 through 6 of figure 4.37 perform the calculations shown in equation 4.15 to solve for the phase from the ratio of the times in between peaks and keyphaser events. ’locy’, represents the indexed locations of the peak in the y signal, ’locx’ is the indexed locations of the peak in the x signal
and lock, is the indexed locations of the keyphaser events. The if statements from line 7 through line 15 just ensure that the phase is calculated with a positive angle corresponding to lagging the Keyphaser so if the value is negative (i.e. leading the Keyphaser) then the value is shifted by 2π. After the phase for each cycle in the sample has been calculated in the for loop, then all phase values are averaged over the whole window in lines 19 through 21 of figure 4.37.
For signals shown in figure 4.35, this script calculated an Absolute X Phase of 180° lagging and an Absolute Y Phase of 270° lagging. The relative phase calculated was 90° X to Y. These values match up exactly with the input signals; However this method is highly dependent on have sufficient cycles in the window for analysis. This often causes issues with phase calculations at lower frequencies such as slow roll speed. A potential fix to this issue would be to use synchronous sampling based off rotor speed which would ensure a constant number of cycles per window. Synchronous sampling is covered in section 4.6.2. This method also is highly dependant upon the 1X frequency being the dominant frequency in the overall waveform. Although this method is highly accurate for clean signals, it is more error prone in noisier signals with multiple other frequencies present. To reduce the reliance on on 1X dominance and clean signals another method was developed in section 4.5.2 using the Frequency Domain.