Skip to main content
1-Visitor
August 16, 2013
Solved

Phase Shift Problem

  • August 16, 2013
  • 3 replies
  • 12220 views

Hi,

I'm currently working on a project which involved some oscillation testing of a scale model. The issue I'm having is that there is a phase lag in the output data, i.e. the maximum force does not correspond with a zero crossing of amplitude as it should. Rather, it is either in phase with the force, or anti-phase with the force. I was hoping there was some way to sort this in MathCAD, it isn't a straightforward phase shift as the phase lag differs with each test run. Is there some coding that would allow to me to check for the various times at which amplitude = 0, and then adjust the data in the force column so that Fmax correlates with A = 0? The frequency and thus period are the same, so by sorting the phase shift corresponding to 1 point, the rest of the data should fall in place accordingly. Hopefully, this could be applied regardless of which data file is used so that for all test runs, Fmax correlates with a zero crossing of amplitude, and the results can be readily obtained.

I've created a very basic mathcad sheet to illustrate the problem. The input values for 'Series' and 'File' can be obtained by checking the arrays on page 3 i.e. the 'ID' column in each array refers to the file input, and R1/R4 refers to series 1/4 respectively.

The non-dimensionalised Force vs Amplitude shows a tilt in the graph which highlights the problem - this graph should be an ellipsis around the y axis passing through the origin.

Any help on this is greatly appreciated. I am using MathCAD 15

Thanks

Best answer by Werner_E

Thats great! Zero padding really works like a charm.

I implemented it in Martin's sheet to get better guess values even if his other data will be not that good behaved as the ones he posted.

3 replies

25-Diamond I
August 16, 2013

Could you show in a sheet an example how you would manually "shift" your data to achieve what you want?

Especially how you would determine the point of maximal force and how the shifting should be applied. As I understand it, shifting Fs to the right would mean getting rid of some values at the end of Fs and the same amount at the beginning at As. Shifting to the left - the other way round. Obviously ts would have to be shortened accordingly, too. So you would end up with shorter vectors not showing full periods as it seems to be now.

BTW, is vector t sorted in every data file? Then I would guess that FindRange() could be written simpler. In any case this routine should not be defined using a global assignment! Its interesting that the results differ slightly (and the first index seems not to be correct in any case) depending which way the function is defined:

global ass.png

Addendum: I just realized that the values t1 and t2 you pick from the tables at the end of your sheet do NOT mark begin and end of full periods. That way your way of getting rid of the constant component by subtraction of mean() does not work as intended. Better seen in the graph if you chose "Crossed" instead of "Boxed".

Maybe better to use As:=As-(max(As)+min(As))/2

Same with Fs, but here its more problematic as its very noisy.

25-Diamond I
August 16, 2013

Here is a shift routine. Not sure if its OK to apply it to Fs/As/ts rather than to A/F/t.

Some questions:

1) Whats the meaning of the values t1 and t2 you pick from the table? Is it mandatory that t2 has to be the last value in ts or may the vector be a but shorter (as is the case when using my shift routine)

2) Whats the output (to be saved) of the overall calculation? (Fs/As/ts or something else? Should it be stored)

3) Is the frequency of the signals 2*pi/5 in every case?

4) Is it really OK to change the measured data by simply shifting force values along the time axis?

Find also attached an animation for your pleasure - as you can see it wouldn't be that easy to decide which shift should be considered best. A perfect circle is not to be expected anyway.

19-Tanzanite
August 17, 2013

Here's another approach that will find the shift with a very high degree of accuracy. Depending on the goal of the analysis, it may also provide parameters that would lead directly to the required solution, also with a high degree of accuracy, and possibly with no need to actually shift the data arrays.

25-Diamond I
August 17, 2013

Here is an appraoch using genfit to find the sinusoidal fit. I guess using FFT could do the job, too.

Additional an avi showing the results for all 27 data sheets.

23-Emerald I
August 20, 2013

A phase shift between force and amplitude may indicate damping, not faulty data.