Chapter 5: Gyrotron control with LabVIEW
5.1 Overview of LabVIEW
LabVIEW is our chosen interface to the Spellman high power amplifier and by extension, the
gyrotron (National Instruments, Austin, TX). There are several other controls that influence
microwave output such as the gun coil (TDK Lambda, Tokyo, Japan), main magnet
(Cryomagnetics Inc., Oak Ridge, TN), alignment stages (Thorlabs, Newton, NJ), and most
notably, the arbitrary waveform generator (AWG) channel on the Redstone spectrometer
(TNMR, Tecmag, Inc., Houston, TX). However, LabVIEW protects the electron gun surface by
turning off the high voltage immediately if one or more interlocks are triggered.
The virtual instruments or VIs in the “GyroControl_(Date)” project folder monitor many inputs
by RS232 electrical interface, and command the power supply to generate AC and DC voltage
for the gyrotron. Many of the inputs serve as interlock set points, which turn off the gyrotron in a
controlled and safe manner in case of a system failure. The main interlocks are internal gyrotron
pressure, water temperature of the gyrotron cooling lines, and the temperature of the magnet
surrounding the gyrotron. These interlocks protect the frequency agile gyrotron during electron
decoupling experiments and continuous frequency microwave experiments. Construction and
processing of a new gyrotron lasts six months to 1.5 years, so it is in the DNP spectroscopist’s
best interest to keep the gyrotron functioning optimally and protect the gyrotron from damage
with the interlocks found in LabVIEW.
5.1.1 Program files
A virtual instrument (VI) is a program file (extension “.vi”) that can collect data and trigger
called the “front panel” and a back end called the “block diagram” and can be linked together
into complex units using global variables.
5.1.2 Front panel
The front panel is the VI user interface window with a grey background that first appears when
the VI is opened (Figure 5.1). When the VI is not running, the various controls, indicators, and
formatting objects can be moved around to any orientation and values in control boxes can be
saved as the default value. When the VI is running, only front panel control variables are editable
and the file cannot be saved. The VI can be started with the straight arrow or repeating arrows in
the upper toolbar and if it runs successfully, it can be stopped with the stop sign button.
Figure 5.1 Front panel for “System Status.vi” in in stopped mode (white arrows and faded stop sign). Start, stop
and pause buttons are indicated by the orange box.
5.1.3 Block diagram
The block diagram window can be accessed by navigating in the top menu to “Window>Show
current VI (Figure 5.2). Controls, indicators, functions, and other components are linked
together by “wires” that indicate the order and direction of operations. As with the front panel, it
can only be edited when the VI is not running. The lightbulb button helps troubleshooting by
slowing the VI and highlighting each step as it activates or fails.
Figure 5.2 Block diagram for “System Status.vi”. The global variables reporting pressure and temperature are
brought here. These values are compared with desired safe points to turn “system status” global variable to true or false. If system status reads false, the heater current and DC voltage are set to zero in “Control and Graphing.vi”. Note that that the front panel does not reflect the complexity of the VI function.
5.1.4 Controls and indicators
Controls are variables placed on either window of a VI. They act as a variable writer and can
change the value of true/false (Boolean), string (alphanumerical characters), numerical, and
many other types of variables. Indicators receive the information from the controls after
functions have been performed on that information. Control wires come out of the right side of
control blocks, and indicator wires connect into the left side of the block, so that the entire block
diagram may be “read” from left to right. A simple example using controls and indicators is
shown in Figure 5.3. If a control or indicator is placed on the front end, its corresponding
marker will be placed on the block diagram. However, a “constant” type control will not
generate a front panel equivalent as the value is entered directly in the block diagram.
Figure 5.3 a) Front panel and b) block diagram for a simple VI representing the equations A*3=X and A*3-B=Y.
The front panel is shown in continuous run mode and the block diagram is shown in the stopped mode.
5.1.5 Global variables
Global variables span different VIs. They can be set as either a control or an indicator type, but it
is best practice to “write” only one indicator per global variable. References to a global variable
in the current “GyroControl_(Date)” folder. “Global.vi” is unique because it does not have a
block diagram, but only a front panel (Figure 5.4). The pressure safe point, temperature safe
point, and heater step size are entered directly into “Global.vi”. Heater step size determines the
value by which the heater current can increase or decrease every LabVIEW cycle. Without this
value to slow down the heater value, the electron gun would be damaged by rapid heating and
cooling. The heater step size can be changed under the “Heater controls” tab in “Global.vi”.
Proportional-integral-derivative (PID) values are also entered into “Global.vi” to control the
electron beam current by adjusting the AC heater current, but these values do not need to be
changed once they are optimized.
Figure 5.4 “Global.vi” front panel showing System Status tab.