10-13-2022 01:12 PM
I'm trying to measure the phase difference between force and acceleration of a specimen attanched to a vibration shaker. In order to verify the setup I've simply attached a rigid block. The issue I'm seeing is that the phase of the two signals is not 0 as I think it should be in this test case. Furthermore, modifying the sampling rate changes the measured phase.
I'm measuring the signals with two different C Series modules - the force (load cell) is measured using an NI 9237 and the accelerometer with an NI 9230. I have both signals in a single task.
After reading about input delay (who knew!) I tried correcting for it. Since I have two modules with input delay, I'm shifting both back by their respective delays. This is accomplished by performing a dummy read before entering the loop and storing the previous samples in a shift register.
The equations I'm using for delay are from the two spec sheets:
I suspect I'm doing something wrong with the correction, but I'm officially out of things to try. Here's a list of what hasn't worked:
I'd appreciate any help!
10-13-2022 01:31 PM
What was the time course of the stimulus? It might be interesting to use a sinusoidal stimulus waveform (with different frequencies, of course) and look at the Bode plot of Force and Acceleration as a function of frequency. It would not surprise me if there were "velocity" effects (e.g. "drag"), not just pure "F = ma".
Are you perhaps "overthinking" the problem?
Bob Schor
10-13-2022 04:21 PM
The stimulus is a continuous sine wave from a function generator so I'm looking at a stable system. The setup with a rigid test peice is to eliminate any phase shift due to the system itself and confirm that the two signals do in fact satisfy the force equation - m = F/a for a known mass. The mass checks out fine within 1-2% error.
I've done a very similar test with a smaller IEPE force sensor that had both signals measured by the NI 9230 so I didn't have any input delay issues.
10-13-2022 05:23 PM
Are you also querying a DAQmx Timing property node to retrieve the *actual* sample rate (as shown in all the simple voltage shipping examples)? I know the 9237 has a relatively small # of discrete *actual* sample rates that are possible and will use the next one higher than whatever unsupported rate you request. A property node query will give you the *true* rate to be used in your delay calcs using fs.
Meanwhile, please post us more details to work with.
- we need actual code. Maybe you haven't done the necessary things to sync their start times, which can be a separate source of apparent phase shift.
- real data would also help. After a run where the data is brought out to a front panel indicator, probably as a graph, do "Edit->Make Current Values Default", then do "File->Save For Previous Version..." back to, say, LV 2018. Then post it.
-Kevin P
10-13-2022 05:37 PM
@Kevin_Price wrote:
Maybe you haven't done the necessary things to sync their start times, which can be a separate source of apparent phase shift.
Sine the OP combined both DAQs into a single task, that should be taken care of behind the scenes by Channel Expansion.
Don't use the formula, use the property node in this link to get the delay for each channel in the task.
10-13-2022 06:35 PM
@mcduff wrote:
Since the OP combined both DAQs into a single task, that should be taken care of behind the scenes by Channel Expansion.Don't use the formula, use the property node in this link to get the delay for each channel in the task.
This is better advice than mine on both counts. It'll still help for you to post code with data.
-Kevin P
10-14-2022 06:33 AM - edited 10-14-2022 06:33 AM
Yeah, I am using the property node for the sample rate... I've been bitten by that before too. Sorry, I thought I included a zip of the project, but it doesn't look like it showed up. I'll try again, but here's a snippet of the main code and the correction for one of the signals. There's a second FGV for the other signal with a different delay.
10-14-2022 06:43 AM - edited 10-14-2022 06:49 AM
@mcduff wrote:
@Kevin_Price wrote:
Maybe you haven't done the necessary things to sync their start times, which can be a separate source of apparent phase shift.
Sine the OP combined both DAQs into a single task, that should be taken care of behind the scenes by Channel Expansion.
Don't use the formula, use the property node in this link to get the delay for each channel in the task.
Thanks, didn't know that existed! I'll give it a shot when I'm back in the lab.
Do you happen to know what the difference is from the calculated value? Is the property somehow timed? Or just a simpler, less error prone way of obtaining the delay?
And yes, the single task was used to both synchronize (I thought) the signals and keep the sampling rates the same to make it easy to obtain the phase shift with the Cross Spectrum vi.
10-14-2022 10:18 AM
@adkin
I have only examined your VIs quickly due to a lack of time. Sorry. But a few suggestions: