LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combustion Engine DAQ - Plotting averages of two inputs against each other

Hello everyone,

 

First, I apologize in advance as I'm sure this question has been answered on these boards. I'm new to Labview and have very little programming background so I'm struggling to even find the correct keywords to google. Perhaps someone can point me in the right direction and I can continue to teach myself.

 

I'm a combustion researcher building an instrumented diesel engine. I have a rotary encoder on the crankshaft and a pressure transducer mounted in the head, reading the combustion chamber. All this is running through a NI USB-6212 DAQ and Labview 2011. I've got my encoder reading in analog mode, where as I rotate it through one revolution the voltage increases from 0 to around 3.5V then zeroes again when it completes a revolution. The transducer is also reading correctly, though I anticipate having to put in more data filtering and processing.

 

What I would like to do is plot them against each other in such a way that it continues to create an averaged pressure trace. Basically, for each X value of rotation, it'll take the incoming pressure data and average them. So for 2.25 volts, which would correspond to a certain point in the engine rotation, it takes each successive pressure point as the engine spins and averages them. Eventually this will create accurate pressure traces of one revolution of combustion. (It's actually a 4 stroke motor so I would essentially have to take every other data point but I'm sure I can figure that out).

 

I have an XY Graph but it doesn't log the data, only showing a few recent data points at a time. I'll also need to add in data analysis to do the averaging, but right now I'm just trying to look at a running pressure trace to determine how accurate the system is.

 

Anyone, if anyone can point me to some examples or VIs that I could start looking at that would be excellent. I attached an image of my block diagram thus far.

0 Kudos
Message 1 of 6
(2,482 Views)

I think what you are looking for is the XY graph and shift registers. Let me know if the attached vi is something what you are wanting to do.

 

-Nilesh



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 2 of 6
(2,469 Views)

This seems promising but not quite there yet. I'll try wiring in the inputs and see if it starts to show promise. In the meantime can you tell me any more about what the shift registering does and why I should use it?

0 Kudos
Message 3 of 6
(2,453 Views)

Shift resigsters are the way to pass data between the the iterations of the loop. Say, you are running an acquisition task in a while loop, and at every iteration it acquires 1000 data points. Now, if you wanted/needed to use data acquired last iteration in current iteration (say for comparison sake or any mathematical operation) you use shift register. This and this should give you a detail idea about how to use it. Shift register is one of the basic and very important/powerful tool.

 

-Nilesh 



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 4 of 6
(2,449 Views)

Alright, shift registers are sounding very promising. I'll have to learn more about array data functions to be able to pass whole cycles back and forth but now I know where to start. The issue is that my measurements aren't time based, they're based on rotations of the rotary encoder. Can I make my while loop clock based on that instead of temporally?

0 Kudos
Message 5 of 6
(2,447 Views)

Your event is based on the value change of the rotary encoder, but your while loop still needs to execute contineously to perform data acquisition. There are different ways to do what you are trying to achieve. To me, the attached example is the simplest way.



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 6 of 6
(2,443 Views)