06-17-2021 03:02 PM
Hello NI community,
I am working on a vi that acquires sensor data and plots them in real time. My setup consists of a pump that is responsible for circulating a coolant in a loop, and 4 sensors - a type K thermostat, a flowmeter and 2 pressure transducers (one on each side of the pump).
I have been able to successfully read data from all sensors. However, I had to add a filter to reduce noise from the pressure sensor data. I used a lowpass Butterworth filter with sampling frequency fs = 3.0, and while it has made the curves smoother, it has caused a time delay.
Here is a snippet demonstrating the problem:
The first figure shows the pressure reading before adding the filter, and the second shows after.
I want to avoid doing this since I am looking to get all the sensor data in real time, and plotted on the same time axis. As you will see in the figure below, there is a lag in the pressure readings.
I should also mention that I used DAQ assistant for flowmeter readings, whereas I used DAQmx vi's for the thermostat and pressure sensor readings. While I have made the plots look like similar, the one for the flowrate is actually a waveform while the other 2 are xy graphs. I was wondering if there is a way I could make an xy graph for flowrate too, with time in seconds plotted on the x-axis. Again, I would like for all 3 plots to be on the same time series.
Also, as you will see, the plot for flowrate is noisy too. I tried to make it smoother by adding a lowpass filter to it as well, but it does not seem to work.
I am attaching the vi with this post. If you could please look into it and suggest any ideas to fix these issues, it would be of great help. To summarize, the 3 issues are:
1) fix the phase difference in pressure readings
2) plot flowrate on an xy graph that shares the x (time) axis with the other 2 plots
3) reduce noise from flowrate
Thank you in advance for any input you may have for me.
Solved! Go to Solution.
06-18-2021 07:27 AM - edited 06-18-2021 07:27 AM
Hi viamotors,
@viamotors wrote:
I should also mention that I used DAQ assistant for flowmeter readings, whereas I used DAQmx vi's for the thermostat and pressure sensor readings. While I have made the plots look like similar, the one for the flowrate is actually a waveform while the other 2 are xy graphs. I was wondering if there is a way I could make an xy graph for flowrate too, with time in seconds plotted on the x-axis. Again, I would like for all 3 plots to be on the same time series.
I am attaching the vi with this post. If you could please look into it and suggest any ideas to fix these issues, it would be of great help. To summarize, the 3 issues are:1) fix the phase difference in pressure readings
2) plot flowrate on an xy graph that shares the x (time) axis with the other 2 plots
3) reduce noise from flowrate
There are some more issues in your VI:
06-22-2021 10:33 AM
Thank you so much! That was very helpful.