git-svn-id: https://bucket.mit.edu/svn/nilm/zoom@7715 ddd99763-3ecb-0310-9145-efcb8ce7c51ftags/zoom-1.0
@@ -0,0 +1,24 @@ | |||||
function [b]= computeI() | |||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |||||
d01 = load('./test-0100'); | |||||
d02 = load('./test-0090'); | |||||
d03 = load('./test-0080'); | |||||
d04 = load('./test-0070'); | |||||
d05 = load('./test-0060'); | |||||
d06 = load('./test-0050'); | |||||
d07 = load('./test-0040'); | |||||
d08 = load('./test-0030'); | |||||
d09 = load('./test-0020'); | |||||
d10 = load('./test-0010'); | |||||
d11 = load('./test-0000'); | |||||
x = [d01(:,2);d02(:,2);d03(:,2);d04(:,2);d05(:,2);d06(:,2);d07(:,2);d08(:,2);d09(:,2);d10(:,2);d11(:,2)]; | |||||
y = [ones(length(d01),1)]; | |||||
y2 = [y*100;y*90;y*80;y*70; y*60;y*50;y*40;y*30;y*20;y*10;y*0]; | |||||
A = [x ones(length(x),1)]; | |||||
b = A\y2; |
@@ -0,0 +1,56 @@ | |||||
data=load('log'); | |||||
dac=data(:,1); | |||||
adc=data(:,2); | |||||
t=1:size(data,1); | |||||
calib=1.385419; | |||||
length(t) | |||||
% adc to actual current in (A/ADC count) | |||||
scale = 2.619482881297628/1000; | |||||
%% get the dc value | |||||
t=50:100; | |||||
dc = mean(dac(t)-calib*adc(t)); | |||||
% extract the part for the light and pc | |||||
t=1080020:1080290; plot(t,dac(t)-calib*adc(t)); | |||||
tx = (t - t(1))*1/8000; % in min | |||||
figure(1); plot(tx*1e3, (dac(t) - calib*adc(t) - dc)/calib*scale,'lineWidth',2); grid on; | |||||
xlabel('Time (ms)'); | |||||
ylabel('Measured current (A)'); | |||||
axEnd = tx(end)*1e3; | |||||
ax = axis; | |||||
axis([ax(1) axEnd ax(3) ax(4)]); | |||||
%% | |||||
t=100090:100358; | |||||
figure(2); | |||||
tx = (t - t(1))*1/8000; % in second | |||||
plot(tx*1e3,(dac(t)-calib*adc(t) - dc)/calib*scale,'lineWidth',2); grid on; | |||||
axEnd = tx(end)*1e3; | |||||
ax = axis; | |||||
axis([ax(1) axEnd ax(3)*2 ax(4)*2]); | |||||
xlabel('Time (ms)'); | |||||
ylabel('Measured current (A)'); | |||||
%% Keithley stuff | |||||
t=1590000:1680000; | |||||
tx = (t - t(1))*1/8000/60; % in second | |||||
figure(3); plot(tx,dac(t)-calib*adc(t) - dc); | |||||
xlabel('Time (s)'); | |||||
ylabel('Measured current (dac count)'); | |||||
axEnd = tx(end); | |||||
ax = axis; | |||||
axis([ax(1) axEnd ax(3) ax(4)]); | |||||
figure(4); plot(tx,dac(t)-calib*adc(t) - dc); | |||||
axEnd = tx(end); | |||||
ax = axis; | |||||
axis([ax(1) axEnd -1700 -1550]); | |||||
xlabel('Time (s)'); | |||||
ylabel('Measured current (dac count)'); |
@@ -1,8 +1,57 @@ | |||||
data=load("log"); | |||||
data=load('log'); | |||||
dac=data(:,1); | dac=data(:,1); | ||||
adc=data(:,2); | adc=data(:,2); | ||||
t=1:size(data,1); | t=1:size(data,1); | ||||
calib=1.385419; | calib=1.385419; | ||||
length(t) | length(t) | ||||
%% adc to actual current in (A/ADC count) | |||||
scale = computeI/1000; | |||||
scale = scale(1); % just the gain part only | |||||
%% get the dc value | |||||
t=50:100; | |||||
dc = mean(dac(t)-calib*adc(t)); | |||||
% extract the part for the light and pc | |||||
t=1080020:1080290; plot(t,dac(t)-calib*adc(t)); | |||||
tx = (t - t(1))*1/8000; % in min | |||||
figure(1); plot(tx*1e3, (dac(t) - calib*adc(t) - dc)/calib*scale,'lineWidth',2); grid on; | |||||
xlabel('Time (ms)'); | |||||
ylabel('Measured current (A)'); | |||||
axEnd = tx(end)*1e3; | |||||
ax = axis; | |||||
axis([ax(1) axEnd ax(3) ax(4)]); | |||||
%% | |||||
t=100090:100358; | |||||
figure(2); | |||||
tx = (t - t(1))*1/8000; % in second | |||||
plot(tx*1e3,(dac(t)-calib*adc(t) - dc)/calib*scale,'lineWidth',2); grid on; | |||||
axEnd = tx(end)*1e3; | |||||
ax = axis; | |||||
axis([ax(1) axEnd ax(3)*2 ax(4)*2]); | |||||
xlabel('Time (ms)'); | |||||
ylabel('Measured current (A)'); | |||||
%% Keithley stuff | |||||
t=1590000:1680000; | |||||
tx = (t - t(1))*1/8000/60; % in second | |||||
figure(3); plot(tx,dac(t)-calib*adc(t) - dc); | |||||
xlabel('Time (s)'); | |||||
ylabel('Measured current (dac count)'); | |||||
axEnd = tx(end); | |||||
ax = axis; | |||||
axis([ax(1) axEnd ax(3) ax(4)]); | |||||
figure(4); plot(tx,dac(t)-calib*adc(t) - dc); | |||||
axEnd = tx(end); | |||||
ax = axis; | |||||
axis([ax(1) axEnd -1700 -1550]); | |||||
xlabel('Time (s)'); | |||||
ylabel('Measured current (dac count)'); |