You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

 LINK TO MEASURING VI

LINK TO RESPONDING VI

LINK TO RUNNING


Introduction

In order to measure the amount of liquid helium in the system at any given moment, a user interface with the platform LabVIEW is needed. The level of liquid helium is controlled by the position of the run valve, which allows it to flow from the separator to the nose (for more information on this process, follow THIS LINK and find Low Temperature: Cryogenics). The run valve has can have any position between 0 and 3 "turns", with 0 turns being completely closed and 3 turns being completely opened. LabVIEW is used to provide a means of automatically measuring and responding to the helium level inside the tank. This is done by running two separate Virtual Interfaces in unison, a Measuring VI and a Response VI.

 

  • The Measuring VI uses a predetermined equation to estimate the current level of the tank based on the valve position. It takes into account randomness of flow and a constant rate of evaporation.


  • The Response VI controls the run valve position. It reads the current level from the Measuring VI, and reacts in order to ensure that the level stays near a user-specified target level. This is the larger of the two VIs and it interacts with the instrumentation involved, like the run valve itself.

The two VIs communicate through the use of text files, which are set by the user. One text file produces data by the Measuring VI with the standard date and time stamp, flow rate, valve position and new level with each iteration. The other text file produces data from the Response VI including the enoch time stamp, the level as read by the Response VI and the new valve position.

Measurement VI

Interface

 

When the VI is first opens up, the first panel to appear is the interface. This panel is where you can comprehensively see how full the tank is at any given moment, and can change a few control factors of the code.

 

One of the controls that will need to be set before the VI can run is the file path (see below). You should set this to a location on your computer's hard drive.

 

                                                                                                                                                                                 

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

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". 

 

Incoming File IO

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.

 

Once the correct valve position string is recorded, it should be converted into a usable number so it can be used in the equations to follow. Finally, the file should be closed when the loop has completed, preferably outside the loop as to not slow things down, but if you want to be able to access the data easier while its running then you can put it back inside the loop.

 

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.

 

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.

 

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

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

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. 

 

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. 

 

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.

 

Response VI:

Interface

This is an example of what the Response VI Interface will look like when first opened. 

 

 

                                                                                                                                           

In the top left hand corner of the interface is run VI icon, and next to it is the text filepath which the user can set. Below is the option for automatic mode (when the VI itself changes the valve position with each iteration) or manual mode (where the user has to specify the exact valve position at any given instance), the boolean indicator for whether the VI and motor are connected properly, and another icon to select when you would like the valve position data to be saved into the text file. Still below that is the indicator for which COMPort the VI is connected to and the valve position indicator. Finally, there are control values for the minimum valve position and maximum valve postition that the user desires for that particular test or trial.

In the middle left of the interface is the control for the target level, which is the level of the tank, set by the user, that the Response VI tries to maintain throughout the trial. Also, if manual mode was selected, the user would have to set the number of turns open in a control located below the target level (in the image above, the VI is running in automatic mode, and so this icon is greyed out. If it were in manual, it would be clear and the target level control would be greyed out instead).

 

 

                                                                                                               

 

The two images above display the three graphs found in the interface, which from top to bottom, respectively, show the level (in other words, the fullness of the tank at that iteration), error (from the target level) and valve position with respect to time. Next to the level graph is an indicator for the current level at that iteration, based on a percentage of 0-100%.

 

 

Lastly, in the bottom left hand corner of the VI is the option to enable advanced controls for the PID loop. If this icon is selected, the PID gains table will appear to its right. The pid loop uses a PID controller and equation constants to run and maintain the level. Unless you have a deep understanding of these coeffecients and need to make edits to them to increase the VI's efficiency, do not try to change these values. If advanced controls are enabled, ..............   At the bottom there is the developer table which ................

 

 

Code

The entirety of the Response VI code is contained within a while loop, in which each iteration lasts 1 second and which can only be stopped by either an error in either VI (while they are running simultaneously) or if the VI is stopped with the use of the stop bool in the developer box.

 

Incoming File IO

Connecting to Machinery

Creating the Proportional-Integral-Derivative (PID) Response

  • understand all the sections
  • visas

Running the VIs

  1. Ensure that all controls in both VIs are accounted for. In the response VI this includes...
    - text file paths are indicated, preferably in the computer's hard drive
    - min and max valve position
    - target level
    - the COMPort is correctly configured

    ...and in the Measuring VI...
    - the text filepath is indicated, in the same folder as the response filepath on the computer's hard drive
    - the standard deviation, which shouldn't be any greater than 1

  2. In the response VI:
    1. the Run VI icon at the top left should be green
    2. the "Motor Connected" bool icon will be red when the VI is not running, but if it does not turn green after about a second of the VI running then the motor is not connected
    3. if you want the VI to automatically change the valve position for a trial, then you should select automatic. This should be done after the connection between the VI and the motor are tested (see Step 3).
    4. the Log Data icon should be green
    5. the Motor Enabled icon should be green, but greyed out

  3. Before running the VIs, you should do a test of the Response VI to make sure everything is working properly. This is done by enabling manual mode and changing the set number of turns open icon to any number between 0 and 3. Once it is determined that this does in fact change the run valve position connected to the motor, then the VI is connected correctly. Once you are done testing, automatic mode should be reselected in order to run a trial.

  4. When the above steps are completed, and the Response VI test has run successfully, the two VIs are ready to be run. Simply run click the run button of both VIs. If this is the first time using one of the textfiles, you may need to run the VI with the respective new text file first.
  5. h

Retrieving Data from the VIs

  • Power Supply Box
  • Step Motor Driver
  • indications on Paul's VI
  • equations on mine
  • how they communicate?



  • No labels