You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

57 lines
1.2 KiB

  1. data=load('log');
  2. dac=data(:,1);
  3. adc=data(:,2);
  4. t=1:size(data,1);
  5. calib=1.385419;
  6. length(t)
  7. % adc to actual current in (A/ADC count)
  8. scale = 2.619482881297628/1000;
  9. %% get the dc value
  10. t=50:100;
  11. dc = mean(dac(t)-calib*adc(t));
  12. % extract the part for the light and pc
  13. t=1080020:1080290; plot(t,dac(t)-calib*adc(t));
  14. tx = (t - t(1))*1/8000; % in min
  15. figure(1); plot(tx*1e3, (dac(t) - calib*adc(t) - dc)/calib*scale,'lineWidth',2); grid on;
  16. xlabel('Time (ms)');
  17. ylabel('Measured current (A)');
  18. axEnd = tx(end)*1e3;
  19. ax = axis;
  20. axis([ax(1) axEnd ax(3) ax(4)]);
  21. %%
  22. t=100090:100358;
  23. figure(2);
  24. tx = (t - t(1))*1/8000; % in second
  25. plot(tx*1e3,(dac(t)-calib*adc(t) - dc)/calib*scale,'lineWidth',2); grid on;
  26. axEnd = tx(end)*1e3;
  27. ax = axis;
  28. axis([ax(1) axEnd ax(3)*2 ax(4)*2]);
  29. xlabel('Time (ms)');
  30. ylabel('Measured current (A)');
  31. %% Keithley stuff
  32. t=1590000:1680000;
  33. tx = (t - t(1))*1/8000/60; % in second
  34. figure(3); plot(tx,dac(t)-calib*adc(t) - dc);
  35. xlabel('Time (s)');
  36. ylabel('Measured current (dac count)');
  37. axEnd = tx(end);
  38. ax = axis;
  39. axis([ax(1) axEnd ax(3) ax(4)]);
  40. figure(4); plot(tx,dac(t)-calib*adc(t) - dc);
  41. axEnd = tx(end);
  42. ax = axis;
  43. axis([ax(1) axEnd -1700 -1550]);
  44. xlabel('Time (s)');
  45. ylabel('Measured current (dac count)');