LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scaling

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

0 Kudos
Message 1 of 16
(4,057 Views)

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

Tim
GHSP
0 Kudos
Message 2 of 16
(4,033 Views)

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

 

Tim
GHSP
0 Kudos
Message 3 of 16
(4,024 Views)

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.

0 Kudos
Message 4 of 16
(4,014 Views)
Can you post your code so that I can look at it. I would try and stay away from local and global variables. Let me look at your code and I can help with a more appropriate solution.
Tim
GHSP
0 Kudos
Message 5 of 16
(4,006 Views)
On check threshold state I need a variable solenoid fire sequence to check the firing order is right and if not give an option to the use to continue with the scan or stop the application that firing order was not right. Please let me know what would be the right thing to do. I still haven't implemented the slope yet.
0 Kudos
Message 6 of 16
(4,001 Views)

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?

Tim
GHSP
0 Kudos
Message 7 of 16
(3,998 Views)

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

0 Kudos
Message 8 of 16
(3,981 Views)
So if I am understanding this correctly.... You need to change solenoide 1 to off get pressure reading then switch it on and get a pressure reading. In one state it should read +32psi and in the other state it should read -10. You need to perform 30 cycles of on and off for the soleniode. Correct?
Tim
GHSP
0 Kudos
Message 9 of 16
(3,972 Views)

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.

0 Kudos
Message 10 of 16
(3,964 Views)