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.
 
 
 
 

30 lines
619 B

  1. # Make a histogram of the error (in milliamps)
  2. a=load("log-locked");
  3. len=size(a,1)
  4. keith=a(:,3);
  5. calib=a(1,4)
  6. dac=a(:,5);
  7. adc=a(:,6);
  8. lookup=load("../../../firmware/lookup.inc");
  9. meas=-(lookup(dac + 1)/64 - calib * adc);
  10. keith_amps = keith * 50; # 50 turns
  11. p = polyfit(meas, keith_amps, 1)
  12. meas_amps = meas * p(1) + p(2); # calibration fit
  13. err_amps = keith_amps - meas_amps;
  14. [n, x] = hist(err_amps*1000, [-15:0.5:15]);
  15. for i = 0:30
  16. cumulative(i+1)=sum(n((31-i):(31+i))/len);
  17. endfor
  18. figure(1);
  19. plot(x(31:61),cumulative);
  20. savedata = [ x' n' ];
  21. save("-ascii", "hist.dat", "savedata");
  22. figure(2);
  23. bar(x,n)