diff --git a/advantest-R6581T-781T0050/fluke-5440B-4670008/README.md b/advantest-R6581T-781T0050/fluke-5440B-4670008/README.md new file mode 100644 index 0000000..75d820d --- /dev/null +++ b/advantest-R6581T-781T0050/fluke-5440B-4670008/README.md @@ -0,0 +1,3 @@ +| Meter Manufacturer | Meter Model | Meter SerialNumber | Source Manufacturer | Source Model | Source SerialNumber | MinMax | File | ID | User | +|--------------------|-------------|--------------------|---------------------|--------------|---------------------|--------|------|----|------| +|advantest|R6581T|781T0050|fluke|5440B|4670008|0.0|/data/advantest-R6581T-781T0050---fluke-5440B-4670008---SWEEP1.jpg|SWEEP1|xans| diff --git a/advantest-R6581T-781T0050/fluke-5440B-4670008/data/INLV-AdvFlu.py b/advantest-R6581T-781T0050/fluke-5440B-4670008/data/INLV-AdvFlu.py new file mode 100644 index 0000000..0eb5886 --- /dev/null +++ b/advantest-R6581T-781T0050/fluke-5440B-4670008/data/INLV-AdvFlu.py @@ -0,0 +1,179 @@ +import GPIBPrologix +import bme280 +import smbus2 +from requests import post + +## Initialize GPIB adapter +GPIB = GPIBPrologix.ResourceManager("/dev/ttyACM0") +# Connect equipment +inst2 = GPIB.open_resource(5) +inst3 = GPIB.open_resource(16) +# Initialize BME280 temperature/humidity sensor +bus = smbus2.SMBus(1) +## Configure equipment +# BME280 temperature/humidity sensor +calibration_params = bme280.load_calibration_params(bus, 0x76) + +# Fluke 5440b Calibrator +inst2.write("STBY") #Standby +inst2.write("ESNS") #ExtSense +inst2.write("EGRD") #ExternalGuard +inst2.write("SOUT 0.0069")#OutputVolts +inst2.write("SCLM 10") #CurrentLimit mA +inst2.write("OPER") #Standby + +# Advantest R6581T +inst3.query("*RST") +inst3.query(":CONF:VOLT:DC") +inst3.query(":SENS:VOLT:DC:RANG 10") +inst3.query(":SENS:VOLT:DC:NPLC 100") +inst3.query(":SENS:VOLT:DC:DIG MAX") +inst3.query(":ZERO:AUTO ON") + +# Measurement functions +def readValue(instObj): + value = instObj.query("FETch?") + return value +def setValue(instObj, inputVar): + instObj.query("SOUT "+str(inputVar)) + return inputVar +def getEnvironment(instObj, i2cbus): + value = instObj.sample(i2cbus, 0x76, calibration_params) + return value + +## Have gitpython pull in the repository +import os +import git +import shutil +username = input("Your 0xC6 git username: ") +password = input("Your 0xC6 git password: ") +remote = f"https://{username}:{password}@git.0xc6.com/xans/INL-Measurements.git" +if not os.path.exists(os.getcwd()+"/INL-Measurements"): + git.Repo.clone_from(remote, os.getcwd()+"/INL-Measurements/") +else: + shutil.rmtree(os.getcwd()+"/INL-Measurements/", ignore_errors=True) + git.Repo.clone_from(remote, os.getcwd()+"/INL-Measurements/") + +## Get needed info to properly label everything +MeterManufacturer = input("Meter Manufacturer: ").lower() +MeterModel = input("Meter Model: ").upper() +MeterSN = input("Meter SN: ").upper() +SourceManufacturer = input("Source Manufacturer: ").lower() +SourceModel = input("Source Model: ").upper() +SourceSN = input("Source SN: ").upper() +measid = input("Personally assigned measurement ID: ").upper() +shellyIp = input("If you use shelly for protection, enter the IP: ").upper() + +if shellyIp and os.system("ping -c 1 " + shellyIp): + print("shelly not found") + quit() +if shellyIp: + url = "{}://{}:{}/relay/0?turn=on".format("http", "192.168.0.101", "80") + post(url) + +## Create proper directory structure +basePath = os.getcwd() + "/INL-Measurements/" +dutname = MeterManufacturer+'-'+MeterModel+'-'+MeterSN +if not os.path.exists(basePath+dutname): + os.makedirs(basePath+dutname) +sourcename = SourceManufacturer+'-'+SourceModel+'-'+SourceSN +if not os.path.exists(basePath+dutname+'/'+sourcename): + os.makedirs(basePath+dutname+'/'+sourcename) +if not os.path.exists(basePath+dutname+'/'+sourcename+"/data/"): + os.makedirs(basePath+dutname+'/'+sourcename+"/data/") +basePath = basePath+dutname+'/'+sourcename +print(basePath+"/data/") + +import csv +import time +import datetime +import numpy as np +import pandas as pd +from math import sin +## Create logfile +logFileName = MeterManufacturer+'-'+MeterModel+'-'+MeterSN+'---'+SourceManufacturer+'-'+SourceModel+'-'+SourceSN+'---'+measid+'.csv' +with open(basePath+"/data/"+logFileName, 'a') as f: + writer = csv.writer(f) + writer.writerow(["DateTime","Set Volts","Measured Volts","Env Pressure","Env Temperature", "Env Humidity"]) +print(basePath+"/data/"+logFileName) + +sweep = np.arange(-11.5,12,0.5) + +cntr = 0 +d = datetime.datetime.now() +dlast = datetime.datetime.now() +## Collect data +time.sleep(3) +for x in sweep: + cntr = cntr + 1 + try: + #Set volt and let accimatize + setPoint = setValue(inst2,round(x,5)) + timebetween = (d-dlast) * (len(sweep)-cntr) + dlast = d + print(str(cntr)+'/'+str(len(sweep))+' Estimated Time Left: '+str(timebetween)) + time.sleep(60) + for i in range(3): + try: + time.sleep(5) + #Get DUT value + readout = readValue(inst3) + #Get envirnmental values + data = getEnvironment(bme280, bus) + #Write to file + d = datetime.datetime.now() + dx = d - datetime.timedelta(microseconds=d.microsecond) + fields=[dx.strftime("%d-%m-%y %H:%M:%S"),setPoint,float(readout),round(data.humidity,2),round(data.temperature,2),round(data.pressure,2)] + print(fields) + with open(basePath+"/data/"+logFileName, 'a') as f: + writer = csv.writer(f) + writer.writerow(fields) + if shellyIp and float(data.temperature) > 30 or float(data.temperature) < 16: + url = "{}://{}:{}/relay/0?turn=off".format("http", "192.168.0.101", "80") + post(url) + except Exception as e: + time.sleep(15) + i = i-1 + except Exception as e: + print(e) + time.sleep(1) + +inst2.write("STBY") #Standby + +## Calculate high order polynomial +df = pd.read_csv(basePath+"/data/"+logFileName) +df = df.groupby(["Set Volts"], as_index=False).mean(numeric_only=True) +highOrderPolyFit = np.polyfit(df["Set Volts"], df["Set Volts"]-df["Measured Volts"], 12) +trendPoly = np.poly1d(highOrderPolyFit) +## Make plot and save +import sys +from matplotlib import pyplot as plt +plt.plot(df["Set Volts"], df["Set Volts"]-df["Measured Volts"]) +polyIndex = np.arange(-11,11,0.01) +plt.plot(polyIndex, trendPoly(polyIndex)) +plt.xlabel('Source Voltage') +plt.ylabel('Delta Set/Meas') +plt.title ('INLV sweep '+ logFileName[:-4]) +plt.savefig(basePath+"/data/"+logFileName[:-4]+".jpg", bbox_inches='tight') + +minVal = trendPoly(polyIndex) +maxVal = trendPoly(polyIndex) +minVal = min(minVal) +maxVal = min(maxVal) +## Write away values to result overview +if not os.path.exists(basePath+'/README.md'): + with open(basePath+'/README.md', 'a') as f: + f.write("| Meter Manufacturer | Meter Model | Meter SerialNumber | Source Manufacturer | Source Model | Source SerialNumber | MinMax | File | ID | User |\n") + f.write("|--------------------|-------------|--------------------|---------------------|--------------|---------------------|--------|------|----|------|\n") + f.close() +with open(basePath+'/README.md', 'a') as f: + linkToImg = "/data/"+logFileName[:-4]+".jpg" + print("|"+MeterManufacturer+"|"+MeterModel+"|"+MeterSN+"|"+SourceManufacturer+"|"+SourceModel+"|"+SourceSN+"|"+str(round((maxVal-minVal),10))+"|"+linkToImg+"|"+measid+"|"+username+"|\n") + f.write("|"+MeterManufacturer+"|"+MeterModel+"|"+MeterSN+"|"+SourceManufacturer+"|"+SourceModel+"|"+SourceSN+"|"+str(round((maxVal-minVal),10))+"|"+linkToImg+"|"+measid+"|"+username+"|\n") + f.close() + shutil.copy(os.getcwd()+'/'+sys.argv[0],basePath+"/data/") + repo = git.Repo(os.getcwd() + "/INL-Measurements/") + repo.git.add(basePath) + repo.index.commit("Add INL Sweep "+ logFileName) + repo.remotes[0].push() + diff --git a/advantest-R6581T-781T0050/fluke-5440B-4670008/data/advantest-R6581T-781T0050---fluke-5440B-4670008---SWEEP1.csv b/advantest-R6581T-781T0050/fluke-5440B-4670008/data/advantest-R6581T-781T0050---fluke-5440B-4670008---SWEEP1.csv new file mode 100644 index 0000000..a50d108 --- /dev/null +++ b/advantest-R6581T-781T0050/fluke-5440B-4670008/data/advantest-R6581T-781T0050---fluke-5440B-4670008---SWEEP1.csv @@ -0,0 +1,142 @@ +DateTime,Set Volts,Measured Volts,Env Pressure,Env Temperature,Env Humidity +17-12-23 20:41:28,-11.5,-11.4999147,55.32,21.57,1031.8 +17-12-23 20:41:33,-11.5,-11.4999149,55.36,21.65,1032.0 +17-12-23 20:41:38,-11.5,-11.4999153,55.4,21.64,1031.9 +17-12-23 20:42:44,-11.0,-10.9999167,55.35,21.7,1031.94 +17-12-23 20:42:49,-11.0,-10.9999167,55.38,21.69,1031.93 +17-12-23 20:42:54,-11.0,-10.9999166,55.36,21.7,1031.97 +17-12-23 20:44:00,-10.5,-10.4999216,55.71,21.79,1032.03 +17-12-23 20:44:05,-10.5,-10.4999221,55.48,21.8,1032.04 +17-12-23 20:44:10,-10.5,-10.4999215,55.52,21.82,1031.99 +17-12-23 20:45:16,-10.0,-9.9999266,54.88,21.87,1032.08 +17-12-23 20:45:21,-10.0,-9.9999267,54.86,21.87,1032.03 +17-12-23 20:45:27,-10.0,-9.9999264,54.84,21.87,1032.03 +17-12-23 20:46:33,-9.5,-9.4999309,54.98,21.86,1032.07 +17-12-23 20:46:38,-9.5,-9.499931,54.96,21.85,1032.05 +17-12-23 20:46:43,-9.5,-9.4999311,54.98,21.86,1032.07 +17-12-23 20:47:49,-9.0,-8.9999348,55.0,21.76,1032.03 +17-12-23 20:47:54,-9.0,-8.9999345,54.98,21.76,1032.06 +17-12-23 20:47:59,-9.0,-8.9999352,54.97,21.75,1032.06 +17-12-23 20:49:05,-8.5,-8.4999389,55.26,21.74,1032.07 +17-12-23 20:49:10,-8.5,-8.4999389,55.27,21.75,1032.08 +17-12-23 20:49:15,-8.5,-8.4999392,55.22,21.75,1032.0 +17-12-23 20:50:21,-8.0,-7.9999435,55.32,21.74,1031.99 +17-12-23 20:50:26,-8.0,-7.9999429,55.32,21.75,1032.01 +17-12-23 20:50:31,-8.0,-7.9999433,55.32,21.76,1032.07 +17-12-23 20:51:37,-7.5,-7.4999478,55.12,21.85,1032.0 +17-12-23 20:51:42,-7.5,-7.499947,55.12,21.86,1032.04 +17-12-23 20:51:47,-7.5,-7.4999476,55.13,21.88,1032.04 +17-12-23 20:52:53,-7.0,-6.9999518,55.07,21.95,1032.11 +17-12-23 20:52:58,-7.0,-6.9999518,55.0,21.95,1032.05 +17-12-23 20:53:03,-7.0,-6.9999515,55.0,21.96,1032.07 +17-12-23 20:54:09,-6.5,-6.4999562,54.63,21.93,1032.11 +17-12-23 20:54:15,-6.5,-6.4999557,54.64,21.93,1032.05 +17-12-23 20:54:20,-6.5,-6.4999559,54.64,21.94,1032.12 +17-12-23 20:55:26,-6.0,-5.9999605,55.03,21.95,1032.07 +17-12-23 20:55:31,-6.0,-5.9999603,55.03,21.96,1032.09 +17-12-23 20:55:36,-6.0,-5.9999598,55.04,21.96,1032.07 +17-12-23 20:56:42,-5.5,-5.4999644,54.68,22.02,1032.12 +17-12-23 20:56:47,-5.5,-5.4999645,54.68,22.03,1032.09 +17-12-23 20:56:52,-5.5,-5.4999645,54.77,22.03,1032.14 +17-12-23 20:57:58,-5.0,-4.9999686,54.66,22.1,1032.07 +17-12-23 20:58:03,-5.0,-4.9999688,54.58,22.11,1032.14 +17-12-23 20:58:08,-5.0,-4.9999684,54.58,22.12,1032.1 +17-12-23 20:59:14,-4.5,-4.4999725,54.52,22.12,1032.09 +17-12-23 20:59:19,-4.5,-4.499973,54.5,22.12,1032.16 +17-12-23 20:59:24,-4.5,-4.4999729,54.35,22.11,1032.11 +17-12-23 21:00:30,-4.0,-3.9999772,54.4,22.1,1032.13 +17-12-23 21:00:35,-4.0,-3.9999778,54.42,22.11,1032.09 +17-12-23 21:00:40,-4.0,-3.9999774,54.45,22.1,1032.1 +17-12-23 21:01:46,-3.5,-3.4999822,54.55,22.07,1032.08 +17-12-23 21:01:51,-3.5,-3.499982,54.59,22.07,1032.12 +17-12-23 21:01:56,-3.5,-3.4999819,54.58,22.06,1032.12 +17-12-23 21:03:02,-3.0,-2.9999858,54.46,22.06,1032.13 +17-12-23 21:03:07,-3.0,-2.9999855,54.46,22.06,1032.16 +17-12-23 21:03:12,-3.0,-2.9999853,54.42,22.04,1032.1 +17-12-23 21:04:18,-2.5,-2.4999901,54.59,22.0,1032.12 +17-12-23 21:04:23,-2.5,-2.4999901,54.54,21.98,1032.06 +17-12-23 21:04:29,-2.5,-2.4999901,54.46,21.99,1032.07 +17-12-23 21:05:35,-2.0,-1.9999945,54.67,21.93,1032.08 +17-12-23 21:05:40,-2.0,-1.9999944,54.75,21.94,1032.12 +17-12-23 21:05:45,-2.0,-1.9999943,54.88,21.96,1032.07 +17-12-23 21:06:51,-1.5,-1.4999982,54.56,22.01,1032.13 +17-12-23 21:06:56,-1.5,-1.4999982,54.56,22.0,1032.16 +17-12-23 21:07:01,-1.5,-1.4999983,54.64,22.0,1032.17 +17-12-23 21:08:07,-1.0,-1.0000019,54.66,21.98,1032.08 +17-12-23 21:08:12,-1.0,-1.0000019,54.69,21.97,1032.09 +17-12-23 21:08:17,-1.0,-1.0000019,54.73,21.98,1032.13 +17-12-23 21:09:23,-0.5,-0.500005,54.66,21.96,1031.99 +17-12-23 21:09:28,-0.5,-0.500005,54.68,21.96,1032.07 +17-12-23 21:09:33,-0.5,-0.5000048,54.74,21.95,1032.0 +17-12-23 21:10:39,0.0,-9.3e-06,54.88,22.01,1031.99 +17-12-23 21:10:44,0.0,-9.5e-06,54.82,22.01,1031.97 +17-12-23 21:10:49,0.0,-9.6e-06,54.8,22.02,1032.01 +17-12-23 21:11:55,0.5,0.4999883,54.6,22.08,1032.03 +17-12-23 21:12:00,0.5,0.499988,54.57,22.07,1031.99 +17-12-23 21:12:05,0.5,0.499988,54.57,22.08,1032.03 +17-12-23 21:13:11,1.0,0.9999843,54.65,22.05,1032.06 +17-12-23 21:13:16,1.0,0.999984,54.64,22.07,1032.05 +17-12-23 21:13:21,1.0,0.9999839,54.68,22.06,1031.97 +17-12-23 21:14:27,1.5,1.4999803,54.7,22.17,1032.0 +17-12-23 21:14:32,1.5,1.4999802,54.79,22.17,1032.03 +17-12-23 21:14:37,1.5,1.4999802,54.76,22.17,1031.96 +17-12-23 21:15:43,2.0,1.999977,54.51,22.17,1032.01 +17-12-23 21:15:49,2.0,1.999977,54.56,22.16,1031.97 +17-12-23 21:15:54,2.0,1.999977,54.54,22.16,1032.04 +17-12-23 21:17:00,2.5,2.4999728,54.53,22.16,1031.93 +17-12-23 21:17:05,2.5,2.4999732,54.45,22.15,1032.03 +17-12-23 21:17:10,2.5,2.4999733,54.43,22.15,1032.0 +17-12-23 21:18:16,3.0,2.9999692,54.5,22.17,1032.03 +17-12-23 21:18:21,3.0,2.9999689,54.46,22.17,1031.98 +17-12-23 21:18:26,3.0,2.9999687,54.4,22.17,1031.98 +17-12-23 21:19:32,3.5,3.4999651,54.38,22.21,1032.03 +17-12-23 21:19:37,3.5,3.4999649,54.39,22.22,1032.04 +17-12-23 21:19:42,3.5,3.499965,54.38,22.22,1032.01 +17-12-23 21:20:48,4.0,3.9999607,54.45,22.21,1032.05 +17-12-23 21:20:53,4.0,3.9999602,54.47,22.21,1032.13 +17-12-23 21:20:58,4.0,3.9999603,54.47,22.21,1032.11 +17-12-23 21:22:04,4.5,4.4999571,54.37,22.2,1032.12 +17-12-23 21:22:09,4.5,4.4999569,54.35,22.2,1032.11 +17-12-23 21:22:14,4.5,4.4999572,54.38,22.2,1032.14 +17-12-23 21:23:20,5.0,4.9999532,54.63,22.21,1032.13 +17-12-23 21:23:25,5.0,4.9999533,54.64,22.2,1032.12 +17-12-23 21:23:30,5.0,4.9999532,54.6,22.21,1032.15 +17-12-23 21:24:36,5.5,5.4999494,54.46,22.19,1032.09 +17-12-23 21:24:42,5.5,5.4999496,54.51,22.2,1032.14 +17-12-23 21:24:47,5.5,5.4999494,54.5,22.2,1032.12 +17-12-23 21:25:53,6.0,5.9999453,54.33,22.2,1032.08 +17-12-23 21:25:58,6.0,5.9999454,54.4,22.2,1032.16 +17-12-23 21:26:03,6.0,5.9999455,54.4,22.2,1032.16 +17-12-23 21:27:09,6.5,6.4999399,54.54,22.14,1032.07 +17-12-23 21:27:14,6.5,6.4999397,54.53,22.14,1032.06 +17-12-23 21:27:19,6.5,6.4999401,54.6,22.14,1032.11 +17-12-23 21:28:25,7.0,6.9999361,54.65,22.16,1032.12 +17-12-23 21:28:30,7.0,6.9999361,54.58,22.16,1032.09 +17-12-23 21:28:35,7.0,6.9999358,54.53,22.16,1032.1 +17-12-23 21:29:41,7.5,7.4999313,54.56,22.22,1032.15 +17-12-23 21:29:46,7.5,7.4999311,54.53,22.24,1032.18 +17-12-23 21:29:51,7.5,7.4999313,54.55,22.24,1032.13 +17-12-23 21:30:57,8.0,7.9999265,54.38,22.29,1032.16 +17-12-23 21:31:02,8.0,7.9999269,54.31,22.28,1032.18 +17-12-23 21:31:07,8.0,7.9999268,54.25,22.28,1032.18 +17-12-23 21:32:13,8.5,8.499922,54.35,22.24,1032.16 +17-12-23 21:32:18,8.5,8.4999224,54.37,22.23,1032.22 +17-12-23 21:32:23,8.5,8.4999223,54.59,22.24,1032.18 +17-12-23 21:33:29,9.0,8.9999175,54.61,22.18,1032.21 +17-12-23 21:33:34,9.0,8.9999175,54.64,22.16,1032.15 +17-12-23 21:33:39,9.0,8.9999177,54.56,22.15,1032.14 +17-12-23 21:34:46,9.5,9.4999126,54.76,22.13,1032.15 +17-12-23 21:34:51,9.5,9.499913,54.71,22.13,1032.09 +17-12-23 21:34:56,9.5,9.4999131,54.7,22.13,1032.13 +17-12-23 21:36:02,10.0,9.9999079,54.63,22.18,1032.13 +17-12-23 21:36:07,10.0,9.9999077,54.65,22.18,1032.13 +17-12-23 21:36:12,10.0,9.9999077,54.64,22.18,1032.14 +17-12-23 21:37:18,10.5,10.4999043,54.49,22.21,1032.07 +17-12-23 21:37:23,10.5,10.4999042,54.58,22.21,1032.07 +17-12-23 21:37:28,10.5,10.4999043,54.69,22.21,1032.11 +17-12-23 21:38:34,11.0,10.9999008,54.5,22.21,1032.07 +17-12-23 21:38:39,11.0,10.999901,54.39,22.21,1032.07 +17-12-23 21:38:44,11.0,10.9999013,54.36,22.19,1032.09 +17-12-23 21:39:50,11.5,11.4999027,54.65,22.11,1032.01 +17-12-23 21:39:55,11.5,11.4999029,54.65,22.11,1032.06 +17-12-23 21:40:00,11.5,11.4999032,54.64,22.11,1032.03 diff --git a/advantest-R6581T-781T0050/fluke-5440B-4670008/data/advantest-R6581T-781T0050---fluke-5440B-4670008---SWEEP1.jpg b/advantest-R6581T-781T0050/fluke-5440B-4670008/data/advantest-R6581T-781T0050---fluke-5440B-4670008---SWEEP1.jpg new file mode 100644 index 0000000..603ee33 Binary files /dev/null and b/advantest-R6581T-781T0050/fluke-5440B-4670008/data/advantest-R6581T-781T0050---fluke-5440B-4670008---SWEEP1.jpg differ