Versions Compared

Key

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

...

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. 

...

Case 3 is activated when the "Motor Enabled" bool is selected. If it is selected,nothing within the VI is changed, but because the motor is reading the position output from the VI the physical position of the motor changes with it.

 

Automatic Mode


Image Modified

In automatic mode, the VI reads the level and, from it, produces a new valve position to bring the level closer to the target level. In this mode, the PID loop is active and continuously reading the level and assigning a new valve position.

...

In this mode, the "Current Position", "Recalibrate", "Set # of Turns Open (Man)" controls and the "Motor Enabled" bool are all disabled and grayed out, but the "Min Open" and "Max Open" controls are enabled. The Min and Max Open values are set by the user, and represent the minimum position that the valve can close to and the maximum position it can open to while running. These values can be changed while the PID loop is active.

 

...


The Proportional-Integral-Derivative (PID) Response

 

The PID response operates by calculating an error from the designated target level and corrects that by using proportional, integral and derivative terms.

...

The above picture shows the code which creates the PID response.

 

In short, the PID loop takes the current level and the target level and compares them to determine what the new valve position should be. It also takes into account the min and max open positions, and converts them to steps. It uses these positions to edit the new position created by the PID loop to ensure its validity.

 

If you want to change the PID gains or are interested in the mathematics behind the PID response, visit my page (yep that is a shameless plug) on Creating the PID Response.

 

 

The image above (from top to bottom) shows how the current level is subtracted from the target level for each iteration, and this data is then used to produce the error graph, which plots the current error from the target level with respect to time.

...

  1. Prior to testing, make sure that...
    1. the LHe level probe is securely fastened in the LHe reservoir
    2. the motor is connected to the computer and the Response VI has direct communication with it (this can be determined by checking to see if the "Motor Enabled" and "Motor Connected" bools are activated).

  2. When testing with LHe, it is not necessary to log data as far as the valve position and the timestamp are concerned. This is up to personal preference, but is always a good idea to collect as much data as possible. (smile)

  3. The same thing applies as far as calibrating the default (zero) position in this situation... when you initialize the valve position, it is important that the valve be completely closed, and that zero is set as the initial position. If this is not done successfully then there is a risk of the valve overturning and breaking. Likewise, the constant velocity should not be too fast in order to prevent the valve from slipping while the program is running.
  4. sajb

Retrieving Data from Text Files

Readable data is retrieved from the VI in a format of a text file, for the purpose of converting the collected data into a format that is easily understood by the user.

 

There are two main text files that would be constantly in use during a test. This includes the Response VI text file, logfile.txt, and the Measuring VI text file, which should be changed with each test, preferably to the date or time the test took place.

 


  1. Finally, once the Response VI is running, you should go check and see that the motor is actively running and that the valve is not slipping (the motor is in sync with the valve and they don't become out of sync during a sharp turn in the other direction - this can cause problems for your valve and may result in something breaking if you don't address the issue).



Retrieving Data from Text Files

Readable data is retrieved from the VI in a format of a text file, for the purpose of converting the collected data into a format that is easily understood by the user.

 

There are two main text files that would be constantly in use during a test. This includes the Response VI text file, logfile.txt, and the Measuring VI text file, which should be changed with each test, preferably to the date or time the test took place.

 

Text files were used as a means Text files were used as a means of providing constant communication between the two VIs while running, as both can be changed and saved during each iteration, so that the data from the last iteration is extracted. This is the case for both text files.

...

The measuring VI text file contains the date and timestamp, iteration number, new flow rate based on the valve position, the valve position , the valve position recorded from the Response VI, and the new level created by the Measuring VI.

 

If you want to save the data from your trials, you should change the name of this text file every time before you begin running.

 

 

recorded from the Response VI, and the new level created by the Measuring VI.

 

If you want to save the data from your trials, you should change the name of this text file every time before you begin running.

 

 

Possible Bugs and Issues

There are a few issues that could come up while using the VIs, especially the Response VI due to its complexity. Some are listed (with their possible solutions) below:

  • if you are in automatic mode and switch to manual, you may not be able to change the value of the valve position the first time if it is the same value that the VI was trying to write to when automatic mode ended (ex: if auto wrote zero to the # of turns open but didn't quite get there, and you are trying to write zero under the #of turns open (man) but its not working, this is likely your issue). This happens because those control values are currently operating in a way where they only change when the value specified changes, not when the user presses enter. A temporary fix would be to just write a negative number to the valve position, as the code is designed to immediately convert any number less than zero to simply zero. A better method is currently in development, by changing the property of the controls so that they change anytime the user signals it (ie the enter key) instead of whenever the actual value is changed.

 

Other How-to Webpages

Property Nodes 




CONGRATS ON MAKING IT TO THE END!!! (or maybe you just scrolled down here)

...