Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

                                                                                                                                                             

Next, you will need to set the standard deviation of the flow rate randomness curve. In order to provide a more realistic measurement of the level, randomness was introduced into the flow rate equation to account for small variations in flow. In order to keep this variation realistic, you shouldn't set the standard deviation anything higher than 1. Also included in the interface are indicators for certain values pertaining to the system at that iteration. For instance, above the standard deviation control there is a "theoretical flow rate" indicator, (in other words, the flow rate calculated before randomness was applied) and below it there is a "realistic flow rate" indicator (the flow rate with randomness taken into account). The blue tank is comprehensive indicator for the level at each iteration. It is measured in percentages of 0 - 100 % full.

...

To the right of this section of the interface there are indicators for the current valve position, the current iteration number and the new level as calculated by the VI. These values are calculated every 1 second (the length of time of one iteration of the code).

 

Code

 

Image Added  

The Measuring VI code uses the reading of the valve position from the Response VI (which will be described later in this link), and uses that position to change the level in the "tank". 

 

 

Image RemovedImage RemovedImage RemovedImage RemovedImage RemovedImage RemovedImage RemovedImage RemovedImage Removed 

Image Added

The VI is set to initially wait one second before starting the VI, 

 

 

 

 

 

 

 

 

 

 

 

 

 

Incoming File IO

 

Image Added

In order to read the valve position for a specific iteration, it must be read into the Measuring VI through a text file. The file that contains the valve position data must be accessed, and it is opened outside the while loop in order to keep the VI running as smoothly as possible (when the file is opened inside the while loop with each iteration, the VIs tend to communicate slower and therefore do not have as long of a run time). When the file is accessed, it takes the last 8 characters from the txt file, which include the width of the number string itself and two end of file characters. The width must be carefully looked at before running, as it is sometimes difficult to get the correct one. If you are receiving an error about how one of the characters is unrecognizable, then it is likely that the width is off. Also, if you check and see while the VIs are running that the valve positions displayed in both VIs do not match, the same issue is present and the width should be altered.

...

Flow Rate Equation and Randomness

 

While any equation would work, the equation in place (while the valve is open) for the flow rate is y = 1/4*ex - 2/5, where y is the flow rate in m/s and x is the valve position in turns. 1/4 was chosen as a constant coefficient for leveling out how much the flow increases, and 2/5 is the constant rate of evaporation of the liquid helium.

 

Image Added

After this equation is performed in LABView, the randomness generator changes the flow rate from the theoretical to a more realistic one, in order to account for viscosity or variations in amounts, etc.The randomness generator uses a standard deviation to return a number that is around the theoretical flow rate, where the average of all the flow rates for each iteration is close to the theoretical.

Image Added                      Image Added

Note that the when the valve is closed, the case structure is activated and the level decreases at a constant rate of .4 m/s.

 

Changing the Level

Image Added

Once the realistic flow rate has been calculated, it is used to change the level of the tank for that iteration. Since the flow rate is calculated in units of m/s, and the time that each iteration lasts is 1 second, the value for flow rate is the same as the amount change of the level for that iteration. This number is then added to the last level of the tank, to become the new level. The new level is then written to the tank, and is also constantly checked to ensure that it is not too high or too low. For instance, if the value becomes less than or equal to zero, the VI stops as the tank is empty. Likewise, if the level is greater than 100, the VI shuts down completely and the level stops changing.

 

 

Text File Assembly

Image Added

Lastly, the text file assembly conveys the data recorded by the Measuring VI into a clear and concise file. At the top of the VI, the text file heading is assembled to indicate the Date, Time, Iteration, Flow Rate, Valve Position and Level. These indicators are collected into a string concatenator and seperated by tabs, and finally followed by a return carriage, which basically enters data into the following line. 

 

Image Added

Also a part of the text file assembly is the actual collection of the data from the VI. First, the time stamp is recorded and then converted into a string to fill the first two "columns" of data. Next, the iteration number is taken, converted into a string, and fills the third. Then the flow rate is recorded into the fourth column, followed by the valve position, which makes up the fifth. Finally, the new level is recorded into the last column after being converted into a string.  

Image Added

Once the text file has been created and written, and the VI is done running, the text file is closed outside of the loop. It is possible to open the text file while it is still running, but it will only contain the data up to the time you opened it, and will not keep updating while open.

...