update 20180517 2100
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
/remote_media/m03/home/pi/adccalib_48.csv
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,62 +1,64 @@
|
||||
#! /usr/bin/python3
|
||||
|
||||
import scipy.optimize as opt
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
lognum = 2
|
||||
|
||||
plt.ioff()
|
||||
plt.style.use('bmh')
|
||||
plt.figure(figsize=(11.88, 8.4))
|
||||
data = pd.read_csv("./log_poticalib_ana_{:02d}.csv".format(lognum))
|
||||
fig, axarr = plt.subplots(2,1, sharex='col',figsize=(11.88, 8.4))
|
||||
data = pd.read_csv("./adccalib_48.csv")
|
||||
|
||||
data['Dv'] = data['v_pit48/v'] - data['v_keith/v']
|
||||
print(data)
|
||||
|
||||
#plt.errorbar(
|
||||
# data['time'],
|
||||
# data['act_curr_ps'],
|
||||
# yerr=data['act_curr_ps']*.002,
|
||||
# label="Spannungsquelle Ausgang",
|
||||
# fmt='.'
|
||||
#)
|
||||
#plt.errorbar(
|
||||
# data['time'],
|
||||
# data['act_curr_el']-.125,
|
||||
# label="Elektronische Last Eingang",
|
||||
# fmt='.'
|
||||
#)#
|
||||
|
||||
data['val_poti'] = data['val_poti'].map(lambda x: int(x, base=16))
|
||||
data['r_bcu/kohm'] = 2*4.7+1/(1/data['r_restheo/kohm']+1/75)
|
||||
|
||||
data['v_bcutheo/v'] = 0.7+0.7*30.1/(data['r_bcu/kohm']+6.49)
|
||||
|
||||
plt.errorbar(
|
||||
data['r_bcu/kohm'],
|
||||
axarr[0].errorbar(
|
||||
data['v_keith/v'],
|
||||
yerr=data['dv_keith/v'],
|
||||
label="V$_{Keith,IV8A}$",
|
||||
data['v_pit48/v'],
|
||||
yerr=data['dv_pit48/v'],
|
||||
label="V$_{MONITOR\_48V}$",
|
||||
fmt='.'
|
||||
)
|
||||
plt.errorbar(
|
||||
data['r_bcu/kohm'],
|
||||
data['v_pit/v'],
|
||||
yerr=data['dv_pit/v)'],
|
||||
label="V$_{PIT,IV8A}$",
|
||||
axarr[0].errorbar(
|
||||
data['v_keith/v'],
|
||||
data['v_ps/v'],
|
||||
yerr=data['dv_ps/v'],
|
||||
label="V$_{PS}$",
|
||||
fmt='.'
|
||||
)
|
||||
plt.plot(
|
||||
data['r_bcu/kohm'],
|
||||
data['v_bcutheo/v'],
|
||||
label="V$_{BCU,O}$"
|
||||
)
|
||||
|
||||
plt.xlabel('$R_{BCU,Set}$/k$\Omega$')
|
||||
plt.ylabel('V$_{1V8A}$/V')
|
||||
plt.title("PowerIt Calibration: Analog Potentiometer")
|
||||
plt.legend()
|
||||
axarr[1].errorbar(
|
||||
data['v_keith/v'],
|
||||
data['Dv'],
|
||||
yerr=data['dv_pit48/v'],
|
||||
label=" absolute Error of ADC",
|
||||
fmt='.'
|
||||
)
|
||||
|
||||
# fit to abs dist
|
||||
linfnc = lambda x,m,c: x*m+c
|
||||
|
||||
pfinal, pcov = opt.curve_fit(
|
||||
linfnc,
|
||||
data['v_keith/v'],
|
||||
data['Dv'],
|
||||
p0=(.1,2.6),
|
||||
sigma=[.5 for e in range(data['Dv'].size)]
|
||||
)
|
||||
|
||||
print( pfinal )
|
||||
|
||||
axarr[1].plot(
|
||||
data['v_keith/v'],
|
||||
data['v_keith/v']*pfinal[0]+pfinal[1]
|
||||
)
|
||||
plt.xlabel('V$_{Keith}$/k$\Omega$')
|
||||
axarr[0].set_ylabel('V$_{IN}$/V')
|
||||
axarr[0].set_title("PowerIt ADC Calibration: 48V Input")
|
||||
axarr[1].set_ylabel('$\Delta$V$_{IN}$ / V')
|
||||
axarr[0].legend()
|
||||
#-plt.savefig("2kw_direct.png")
|
||||
|
||||
plt.tight_layout()
|
||||
plt.savefig("adccalib_{:02d}.eps".format(lognum), format='eps', dpi=1000)
|
||||
plt.savefig("adccalib_48.eps", format='eps', dpi=1000)
|
||||
|
||||
Reference in New Issue
Block a user