<jupyter_start><jupyter_text>![alt text](logo.png "Logo")  Advanced Physics Lab 3711/3721    Plasma Physics - Langmuir Probe    23 August 2017    IntroductionThis particular notebook is written to guide you through the experiemental setup and to communicate with the Keithley 6487 Picoammeter/Voltage Source that is connected to the JL03 PC in North Classroom 3606 (the code cells are written in Python). **Be sure to thoroughly read the entire notebook.**  SafetyWe will learn how to create a plasma by applying a DC voltage between two electrodes in a partial vacuum. This methodology is similar to the physics behind fluorescent light tubes and neon signs. **DANGEROUS VOLTAGES** may be present while conducting this experiment. Do not operate any equipment until you are confident that you can do so safely. Please use caution and be aware of what you are touching. **Familiarize yourself with the equipment before turning anything on.**A helpful (and perhaps life-saving) guideline when using equipment is to utilize a *one-hand-only* technique, and focus your attention on one operation at a time. Additionally, keeping your other hand (if it exists) in you pocket should mitigate any risk of current flowing across your chest.  Experimental Setup Below is a digital photograph of the current experimental setup. We have added an Ammeter inline with the grounded side of the High Voltage Power Supply to monitor the DC discharge current, and it is not represented in ** *Figure 1* **. If what you find in the lab looks different from the image below (other than the Ammeter), please find an instructor or the lab manager before proceding.![Experimental Setup](overview.png "Experimental Setup")*Figure 1:This is an image of the experimental setup.*  Setting the PressureWe need to first get the pressure in the system down to an appropriate level such that a DC discharge can be generated between the two electrodes in the tube. There are a few things to do/check before turning on the vacuum pump. They are as follows:+ Make sure the blue Kurt J. Lesker pressure gauge is plugged in. The plug is to the back-left of the experiment enclosure+ Check the pressure reading - it should be around atmospheric pressure (verify the measurement given Denver's elevation!).    + If the pressure is lower than expected, open all four needle valves (turning them counter clockwise until a slight resistance is felt) .+ After verifying the pressure reading does indeed match the expected value, close all four needle valves by turning them clockwise until a slight resistance is felt. **DO NOT FORCE THE VALVES CLOSED! THE VALVE SEATS CAN BE DAMAGED IF TURNED TOO FORCEFULLY.**+ There are two on/off ball valves. **Both must be closed before turning the vacuum pump on OR off.**    + The valves are closed when the lever is positioned perpendicular to the tubing - see ** *Figure 2* **.+ After verifying that the valves are closed, you may turn the vacuum pump on.+ Slowly open the ball valve on the vacuum pump. Then (**very slowly**) open the ball valve on the back left of the experiment enclosure.+ You should notice the pressure reading start to drop. The pressure range of interest is 150-700 mTorr.![Ball Valves Off](ball_valves_off.png "Ball Valves Off")*Figure 2:This image shows the orientation of the ball valves while in their off position. The left pane is the valve on the vacuum pump, and the right pane is the valve on the back left of the experiment enclosure.*We want to approach a stable pressure. The range of interest is 250-600 mTorr. To adjust the pressure, we need to open the various needle valves on the front left of the experiment enclosure. The left most valve is a "coarse" valve. The valve to the right of the "coarse" valve is "medium", and the two right most are "fine" valves. See ** *Figure 3* ** for a picture of the needle valves.![Needle Valves](needle_valves.png "Needle Valves")*Figure 3:This is a picture of the needle vavles used to adjust the pressure in the system. The left most valve is a "coarse" valve. The valve to the right of the "coarse" valve is "medium", and the two right most are "fine" valves.*  Creating a DC Discharge After we have a stable pressure within the range of 250-600 mTorr, it's time to create a DC discharge between the two electrodes. **Before turning on the High Voltage power supply, verify that the patch cables are connected to the correct ports (note that the patch cables should all be using a high voltage wire - they have a white silicone insulation over the wire). Additionally, make sure that the polarity is set to NEGATIVE! This switch is directly above the patch cables.** See ** *Figures 4, 5, and 6* **.![High Voltage Power Supply Polarity](polarity.png "High Voltage Power Supply Polarity")*Figure 4:This image shows the CORRECT setting for the high voltage power supply polarity. Given this, we are setting the Annode potential to ground, and the Cathode at a large negative potential (relative to ground).*![High Voltage Power Supply Wiring](wiring.png "High Voltage Power Supply Wiring")*Figure 5:This image shows the propper wiring configuration for the High Voltage Power Supply. **Be sure to verify this and that you understand what's going on in the circuit.** **Figure 6** might help.*![Circuit Schematic](schematic.png "Circuit Schematic")*Figure 6:This is a schematic of the circuit. The line drawn into the vacuum tube represents the Langmuir Probe*One more check before turning on the high voltage source. Make sure all the OUTPUT VOLTAGE knobs are set to 0 and the HIGH VOLTAGE switch is turned off (to the left). After following the steps, and verifying that everything is connected, we can turn the POWER switch on (to the right). Upon turning the switch on, the ON light should illuminate. After about 10 seconds, you should hear an interal click followed by the STD BY RESET light turning on. The high voltage source is now ready to use.**Be aware that you do not place any body parts (hands, arms, etc) or other objects near the connectors of the patch cables while the High Voltage Power Supply is turned on. The connectors are only rated for HANDS FREE OPERATION above 60 Volts DC.**We also want to monitor the total current of the DC discharge. The Fluke multimeter is connected to measure this. Turn on the multimeter and set it to measure DC current (the scale is mA).Once we are ready, turn the HIGH VOLTAGE switch on (to the right). Then start increasing the OUTPUT VOLTAGE knobs (starting with the 0-1500 knob). The "sparking potential", or minimum voltage difference required to initiate a DC Discharge, varies as a function of pressure (and, in fact, electrode separation). You should expect to see a discharge around 1000-1500 Volts. ** Be sure to monitor the dicsharge current as well. DO NOT EXCEED 8mA. ** See ** *Figure 7* ** for a preview of what to expect.![PLASMA!](plasma.png "PLASMA!")*Figure 7:This image shows a DC Discharge between the two electrodes in the vacuum tube. The Annode is on the right, and the Cathode is on the left.*Once a stable DC Discharge has been created, we are ready to investigate the plasma!  Acquiring the Langmuir Probe Current-Voltage (I-V) CharacteristicNow we want to sweep the potential of the Langmuir probe relative to both the floating potential and the plasma potential in the region of the probe. The first thing we need to do (apart from turning the Keithley on - do this now if it is powered off) is import some Python libraries to communicate with the Keithley 6487 Picoammeter/Voltage Source, and to manipulate and display the acquired data. Execute the cell below by clicking on the cell and pressing "Shift+Enter" (alternatively you could click on the cell and then click the play button on the top banner). Note: On the left of each "code" cell, you will see "In [ ]:". After you execute a cell, this will change to "In [  ]:", where  will be an integer that represents the order you executed the cells in a particular session (beginning with 1 and monotonically inscreasing). While the cell is running, you should see an asterisk within the brackets of "In [ ]:" on the left of the cell. The asterisk will change to an integer when complete.<jupyter_code># DO NOT EDIT THIS CELL

import numpy as np # This is the fundamental package for scientific computing with Python.
import visa # This is the pyVISA library - it allows us to communicate with instruments (like the Keithley 6487!).
import time # This library allows us to keep track of time
from bokeh.plotting import figure, output_notebook, show, vplot # This is a plotting library<jupyter_output><empty_output><jupyter_text>Now we will open communication with the Keithley and send it some initialization commands. It is located at the "COM1" port. We need to also define how the device is configured in the RS-232 communications protocol. In general, for RS-232 communications, you need to specify:+ Baud Rate+ Flow Control+ Terminator Characters+ Parity+ Data BitsFor our case the Keithley is set to all the default parameters, except the Terminator. The settings for the the Keithley are: + Baud Rate: 9600+ Flow Control: None+ Terminator Characters: Carriage Return+ Parity: None+ Data Bits: 8Now, run the cell below.<jupyter_code># DO NOT EDIT THIS CELL

# Setting up a resource manager to communicate with the Keithley, using the imported pyVISA library.
resource_manager = visa.ResourceManager() 

# Opening the instrument - note we specify the read and write termination
keithley = resource_manager.open_resource("COM1", read_termination = '\r', write_termination = '\r') 

keithley.write('*RST') # Return 6487 to defaults.
keithley.write('FORM:ELEM READ,VSO') # Setting up Keithley to send the Current and Voltage.
keithley.write('RANG:AUTO ON') # Enable auto current range.
keithley.write('SOUR:VOLT:RANG 500') # Select 500V source range.
keithley.write('SOUR:VOLT 0') # Set voltage source output to 0V.
keithley.write('SOUR:VOLT:ILIM 2e-3') # Set current limit to 2mA.
keithley.write('SYST:ZCH OFF') # Disable zero check.<jupyter_output><empty_output><jupyter_text>The cell below will define a function that we will use later. This function will tell the Keithley to sweep through a set of voltages that we will set in a moment, and then store the measured current for each voltage step.<jupyter_code># DO NOT EDIT THIS CELL

def vsweep(v_low, v_high, v_step, v_float):

    N_steps = abs(v_high - v_low)/v_step # Number of steps
    vs = np.arange(v_low, v_high + v_step, v_step) # generate an array of Voltage values
    t_delay = .2 # Time (in seconds) to pause while reading/writing to the Keithley
    
    keithley.write('SOUR:VOLT:STAT ON') # Put voltage source in operate.
    keithley.write('SOUR:VOLT ' + str(v_low)) # Set the voltage source to the lowest setting

    fdata = np.zeros(shape=(N_steps + 1, 2)) # Create empty array the length of our data set that we will fill with data below

    time.sleep(t_delay) # Wait for the time that we specified
    
    # Looping through the voltages we defined
    for i,v in enumerate(vs):
            keithley.write('SOUR:VOLT ' + str(v)) # Telling the Keithley a voltage to set
            time.sleep(t_delay) # Wait for the time that we specified
            a = keithley.ask('READ?') # Reading the Current and Voltage and storing it
            time.sleep(t_delay) # Wait for the time that we specified
            b = a.split(",") # Parsing the data sent from the Keithley - it sends us a 'string'
            fdata[i] = [float(b[1]),float(b[0])] # Storing data into the ith row and converting the 'string' to a 'float'
                               
    keithley.write('SOUR:VOLT ' + str(v_float)) # Setting the Keithley to the floating potential that we passed to 'vsweep' 
    
    return fdata # Return the collected data<jupyter_output><empty_output><jupyter_text>Next, we define our scanning limits and other variables. Some notes about these parameters:+ v_low - This is the starting voltage. The default starting point is -200V. **DO NOT EXCEED -450V.**+ v_high - This is the ending voltage. The default ending point is -150V. **DO NOT EXCEED -50V.**+ v_step - This is the voltage step. 5 V is a good starting point.+ v_float - This should be near the probe floating potential. The default is -200V.<jupyter_code># Modify the parameters below to suit your desired scan. If you change the parameters for future scans, you need to 
# execute the cell again to set the new values.

vlow = -200 # Lowest voltage
vhigh = -150  # Highest voltage
vstep = 5 # Voltage Step
vfloat = -200 # This is near the measured floating potential of the Langmuir Probe<jupyter_output><empty_output><jupyter_text>Alright. Now we should have the Keithley in a state where we can sweep the Langmuir Probe potential. The function 'vsweep' sets the Voltage Source on the Keithley to the floating potential *v_float* that we defined a few cells up after sweeping through the voltages that we specify - this is to minimize any current through the probe when not needed. Let's go!<jupyter_code>#This first if statement will delete the previous data if it exists. So, if you want to keep your data, save it in a cell below!

if 'data' in locals(): 
    del data
    
data = vsweep(vlow, vhigh, vstep, vfloat) # This calls the function 'vsweep' that we defined a few cells up<jupyter_output><empty_output><jupyter_text>When you are completely finished with your data collection, please close out the data acquisition session by executing the cell below. You may not wish to do this the first time you arrive to this point in the Notebook. Move on to the next section before determining if you are finished.<jupyter_code># DO NOT EDIT THIS CELL

keithley.write('SOUR:VOLT:STAT OFF') # This turns off the Voltage Source (and blue light) on the Keithley
keithley.close()<jupyter_output><empty_output><jupyter_text>Plotting the Langmuir Probe Current-Voltage (I-V) CharacteristicNow that we have acquired the data, let's have a look at the result! The cell below will create an interactive plot of the IV curve.<jupyter_code># DO NOT EDIT THIS CELL

# Specifying that we want the plot to be displayed within the notebook
output_notebook(hide_banner=True)

# create a new plot with a title and axis labels
p = figure(title="Langmuir IV Curve", x_axis_label='Voltage (V)', y_axis_label='Current (A)', plot_width=950, plot_height=600)

# specify the data to plot and define the line type - here we will use a circle for the data points
p.circle(data[:,0], data[:,1], fill_color="white", size=8)

# show the results
show(p)<jupyter_output><empty_output><jupyter_text>Saving your dataSpecify the filename for saving your data below. At this time the following cell **WILL OVERWRITE** any file that has the same name, so be sure to change the "FILENAME" before executing this cell if this is not desired.<jupyter_code>np.savetxt('FILENAME.csv', data,
                      fmt='%.18e',
                      delimiter=',',
                      newline='\n',
                      header='',
                      footer='',
                      comments='# ')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06130394615283093, 'fraction_numerical': 0.010162333377326119, 'mean_word_length': 4.240318118948824, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '425341', 'license': 'MIT', 'n_tokens_mistral': 4172, 'n_tokens_neox': 3894, 'n_words': 2239, 'path': 'Langmuir Probe/ipynb_checkpoints/experimental_setup-checkpoint.ipynb', 'repo_name': 'gerudo7/Junior-Lab', 'size': '15154'}