03-17-2010 04:00 PM
I have a sensor that calculates both pressure and vacuum. When I caliberated the sensor I received different slopes and offset for pressure and vacuum respectively. I have a certain sequence of solenoid states and I have to measure the pressure and vacuum flow rate. Sequence for ex:
Step 1) Solenoid 1 (pressure state), the system will go from 0psi to 32psi. Start the timer at 10psi and stop the timer at 32psi and based on time calculate flow rate.
Step 2) Solenoid 1 (vacuum state), 32psi to -10psi. Start the timer at 10psi and stop the timer at -10psi and calculate vacuum flow rate.
Step 3) Solenoid 2 and so on
Issues:
1) How do I apply different scaling?. I read the voltage using DAQ read and if its < 1.16 I need vaccum scaling and if not pressure scaling. Should I use some property node to implement it.
2) How can I implement the timer.
I would really appreciate if someone could direct me.
Thanks
03-18-2010 10:24 AM
I have a project where I am doing the exact same thing except for the timing. I am doing pressure and vacuum. Are you using one sensor to do this or multiple?
The way I am doing mine is:
I have one sensor that has a -14.7 to +30psi rating with an output of 0-10VDC.
If I scale this sensor I use a linear slope doing a calculation for the full range of 44.7 psi / 10 VDC = 4.47 slope.
If you take this number and times it times the voltage from your sensor you should get a number that is close to what you want.
As far as thee timing goes that is a bit more complicated. You can use a while loop and store the time when you go past 10 and when you get to your desired position. Then you can do the math to get the differential time.
Look at my example
03-18-2010 10:40 AM
Also for the scaling you need to subtract what the voltage is when the sensor is at 0 psi.
Scale should look like:
voltage - voltage at zero * 4.47 psi/volt (assumes a -14.7 to 30 psi sensor with a 0 - 10 VDC output) = pressure. This will give you a positive and negitave pressure. This way you do not need two scales.
So if we assume that your voltage is at 3 volts when at zero you get the following result:
3 volts - 3 volts * 4.47psi/volt = 0
So if we assume that your voltage is at 5 volts you get the following result:
5 volts - 3 volts * 4.47psi/volt = 8.94 psi
So if we assume that your voltage is at 1 volts you get the following result:
1 volts - 3 volts * 4.47psi/volt = -8.94 psi
03-18-2010 12:18 PM
Thankyou so much for your help. I just have one more questiion. For each solenoid I calculate the pressure and
vaccum and display it with the flow rate and the sequence has to progress in a right order. I have a case
structure based on state machine from a queue. In state "scan" I scan all my analog input channels and in state
"calculate pressure/vac" I use the slope to calculate pressure/vac. I have a state to check sequence and I would
like to create a static variable which should increment evertime I get into this state and check my solenoid firing
sequence is right. This firing sequence is 0,1,2,3..30. Is it possible to do this with local variable or should I use
global variable. Are is there any other method I could use to keep track of my firing sequence and log the sequence at the end.
03-18-2010 12:34 PM
03-18-2010 12:49 PM
03-18-2010 01:09 PM
What do you mean by variable sequence for the solenoid?
How are you going to check the firing order? Do you get a pressure or something back if you open a particular solenoid?
03-18-2010 02:00 PM
Yes when I fire a solenoid the pressure on the tube should reach 32psi and when its open it should reach -10psi
vacuum. I am used to programming in text based language. What I meant by variable is if it was C I would have
used a static variable "solenoid_sequence" and check the index of threashold peak detector.vi with this variable.
Static by default in C will be initialized to zero then increment the variable. And when the next solenoid fires I will
check if its equal to 1 and so on to make sure i get the order right.
Thanks
03-18-2010 03:38 PM
03-18-2010 03:56 PM
Yes that is correct. I also placed a PSI indicator LED array keeping in mind that I can use the color[4] property to enable different color. For example initially in off state, green when the pressure reaches 10psi indication I started the timer, red when pressure reaches 32psi indicating I stopped the timer, then display the flow rate using some digital numeric indicator. I was able to change for a single LED using that property but when it comes to array I am not sure how to implement that.
Thanks for your help.