Difference between revisions of "DAQ Testing/20180727"

From PREX Wiki
Jump to navigationJump to search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
Main Page - [[DAQ Testing]] - July 27th, 2018
+
Back to [[Main_Page|Main Page]] >> [[DAQ_Doc_Portal|DAQ Documentation Portal]] >> [[DAQ_Testing|DAQ Testing]] >> [[DAQ_Commissioning_Notes|DAQ Commissioning Notes]]
Testers: Cameron and Chandan
 
  
Goal: Test HAPPEX and QWeak ADCs in Right HRS Parity DAQ for functionality and dynamic range
+
>> [[DAQ_Testing/20180728|Next Day of Testing]]
 +
 
 +
July 27th, 2018 Testers: Cameron and Chandan
 +
 
 +
See [[DAQ_Meeting/20180727|Today's Meeting Notes]]
 +
 
 +
== Goal ==
 +
 
 +
Cameron and Chandan learn how to test DAC and ADCs with Bob Michaels
  
 
== Calibrate RHRS HAPPEX Timing Board (HAPTB ) 12 and 16 bit DAC ==
 
== Calibrate RHRS HAPPEX Timing Board (HAPTB ) 12 and 16 bit DAC ==
  
 
To calibrate the 12 and 16 bit DACs we:
 
To calibrate the 12 and 16 bit DACs we:
* Log into the RHRS ROC with telnet (see [[DAQ_Networking|Network Map]])
+
* Log into the RHRS ROC with telnet (see [[DAQ_Network_Map|Network Map]])
 
* Set the DAC output level with the C code command '''setDACHAPTB(DAC#,Level#)'''
 
* Set the DAC output level with the C code command '''setDACHAPTB(DAC#,Level#)'''
 
* Read the DAC output level with a voltmeter
 
* Read the DAC output level with a voltmeter
 
** DAC# 1 = 12bit, 2 = 16 bit
 
** DAC# 1 = 12bit, 2 = 16 bit
** 12 Bit DAC Level# unknown scale, testing with voltmeter determines - expect positive voltages for values that range within Level ⊂ [0, 2^12 - 1 = 4095] modularly
 
*** Level = 200 -> Voltage read = 0.480V
 
*** Level = 300 -> Voltage read = 0.731V
 
*** Level = 400 -> Voltage read = 0.976V
 
*** Level = 500 -> Voltage read = 1.220V
 
*** Level = 600 -> Voltage read = 1.464V
 
*** Level = 700 -> Voltage read = 1.708V
 
*** Level = 800 -> Voltage read = 1.952V
 
*** Level = 900  -> Voltage read = 2.19V
 
*** Level = 1000 -> Voltage read = 2.44V
 
*** Level = 1100 -> Voltage read = 2.68V
 
*** Level = 1200 -> Voltage read = 2.92V
 
*** Level = 1300 -> Voltage read = 3.17V
 
*** Level = 1400 -> Voltage read = 3.41V
 
*** Level = 1500 -> Voltage read = 3.66V
 
*** Level = 1600 -> Voltage read = 3.90V
 
*** Level = 1700 -> Voltage read = 4.15V
 
*** Level = 1800 -> Voltage read = 4.39V
 
*** Level = 1900 -> Voltage read = 4.63V
 
*** Level = 2000 -> Voltage read = 4.88V
 
*** Level = 2100 -> Voltage read = 5.12V
 
*** Level = 3000 -> Voltage read = 7.32V
 
*** Functional V = 0.0024402 * Level - 0.00257905
 
** 16 Bit DAC Level# unknown scale, testing with voltmeter determines - expect negative to positive voltages for values that range within Level ⊂ [0, 2^16 - 1 = 65535] modularly
 
*** Level = 300 -> Voltage read = -4.92V
 
*** Level = 400 -> Voltage read = -4.94V
 
*** Level = 500 -> Voltage read = -4.92V
 
*** Level = 2000 -> Voltage read = -4.69V
 
*** Level = 3000 -> Voltage read = -4.54V
 
*** Level = 8000 -> Voltage read = -3.77V
 
*** Level = 12000 -> Voltage read = -3.16V
 
*** Level = 16000 -> Voltage read = -2.55V
 
*** Level = 20000 -> Voltage read = -1.94V
 
*** Level = 24000 -> Voltage read = -1.32V
 
*** Level = 28000 -> Voltage read = -0.72V
 
*** Level = 32000 -> Voltage read = -0.07V
 
*** Level = 36000 -> Voltage read = 0.49V
 
*** Level = 40000 -> Voltage read = 1.10V
 
*** Level = 44000 -> Voltage read = 1.71V
 
*** Level = 48000 -> Voltage read = 2.32V
 
*** Level = 52000 -> Voltage read = 2.93V
 
*** Level = 56000 -> Voltage read = 3.54V
 
*** Level = 60000 -> Voltage read = 4.15V
 
*** Level = 64000 -> Voltage read = 4.76V
 
*** Level = 68000 -> Voltage read = -4.61V (Modular wraps around)
 
*** Functional V = 0.000152329 * Level - 4.9871
 
  
== Testing LHRS HAPPEX ADCs using 12bit DAC ==
+
== Testing RHRS HAPPEX ADCs using 12bit DAC ==
 
* To test an ADC channel
 
* To test an ADC channel
 
** Set a specific ADC slot and channel number's gains in the Prex_ts.crl file (in ~/devices/crl/) and make with "makelist Prex_ts.crl ppc"
 
** Set a specific ADC slot and channel number's gains in the Prex_ts.crl file (in ~/devices/crl/) and make with "makelist Prex_ts.crl ppc"
Line 72: Line 33:
 
* RHRS "adcx2" according to tape label = first ADC on the left (of two options) of the 18bit ADC crate; address = 0 in ROC26 crate, name = adcx7 in ~/bpan18/pan/control.db
 
* RHRS "adcx2" according to tape label = first ADC on the left (of two options) of the 18bit ADC crate; address = 0 in ROC26 crate, name = adcx7 in ~/bpan18/pan/control.db
 
** test by logging into HAPPEX7 via telnet and running int and conv gain settings (adcModule#=0) in there while CODA takes data in the background
 
** test by logging into HAPPEX7 via telnet and running int and conv gain settings (adcModule#=0) in there while CODA takes data in the background
** First channel test - 12 bit DAC
+
 
*** Run number 4040 - Level = 300, 500, 700, 1400, 2000, 3000, 500; conv = 1, int = 3
+
== To Do ==
**** "adc18_ana/newrun 4040 5500 26 0" yields an output file ~/adc18_ana/adc18_4040.root with NTuple adc18 inside
+
* Test ADCs and continue in todo list
**** Plotting with "adc18->Draw("adc0:event") we see signals, but miss the last 500 Level region, and it doesn't look like it saturates (even thought the voltage into the channel is 7.3 volts, higher than the quoted 5 volts)
+
* Perfect and better justify parameters in Ramp testing function (and separate it out into a specific ramp-testing .crl file to avoid messing with the main Prex_ts.crl functionality)
*** Run number 4041 - set the level to 500 (~1.22 Volts 12 bit DAC) flat the whole time for 2600 events; conv = 1, int = 3
+
* Move the RJ45 cable to a better location on the RHRS, with more slack and less likelihood of getting in the way of other people\
**** Plotting adc0:event shows that the level comes out to ~28000, which is ~12% of the supposed range of the 18 bit ADCs
+
* Check if something like int = 2 and conv = 0 is actually a more suitable gain setting
*** Run number 4042 - 500, 800, 1000, 1400, 400, 1800, 2000, 2400, 400; conv = 1, int = 3
+
* Understand the nature of "saturation", why signals over 5V are suitable if the gain is low enough, and what non-linearities arise near saturation
**** Plotting adc0:event shows again that we don't saturate - the peak value is just 140,000 now (for 2400 Level ~ 6 volts input signal)
+
* Put all of the DAQ software into a [https://www.github.com/JeffersonLab JeffersonLab] repository and track it adequately
*** Run number 4043 - set the gain to int 3, conv 1 (I thought I set 6, but maybe missed), run DAC from 500, 800, 1200, 1600, 2000, 2400
+
* (JAPAN?) Develop a similar ramping function but to use a constant DAC value and systematically scan the gain settings to understand the linearity, starting points, and relative significance of Integrator and Conversion gains
**** Plotting adc0:event should saturate probably
+
* Learn how to tweak and characterize QWeak ADCs (begin with RHRS QWeak ADCs)
**** It doesn't - I think the gain settings are getting overwritten by hitting start new run in CODA...
+
* Do the LHRS, Injector, and Counting House
*** Run number 4044 - recompiling the Prex_ts.crl with higher gain (int = 1 and conv = 10) hard coded in to try to see saturation, run DAC from 2800, 500, 800, 1200, 1800, 2000, 2100, 3000, 500
+
 
**** Plotting adc0:event should definitely saturate now
 
**** In fact it does - it saturates for all values tried, including 500 - the saturation level (for all channels on this ADC) is approximately 256000 ADC channels (in agreement with the expectation from the available bit space for 18 bit board)
 
*** We need to figure out how to get the gain values to update and not get overwritten by the .crl defaults (do the reading trick where it assumes the boot script had set it up first?)
 
*** Not obvious, lets just use the .crl hard coded numbers for now to get an initial result (and reboot CODA)
 
*** Run number 4045 showed that .crl overwrites telnet adc18_setconv(0,#) or adc18_intgain(0,#) every time when the settings are hard coded
 
*** Run number 4046 uses int = 3, conv = 5; DAC level starts at 500, 800, 1200, 1600, 2000, 500, 2400
 
**** This shows saturation at around level 1900 (ADC reads 258000 flat y value for 2000 and 2400 settings)
 
**** We should reduce the gain again to achieve the desired 5V = 2100 level at the 75% max saturation (0.75*258000 ~= 193000 for level 2100)
 
*** Run number 4047 had a CODA error
 
*** Run number 4048 uses int = 3, conv = 3; DAC level starts at 500, 800, 1200, 1600, 1900, 2100, 500, 2400, 500
 
**** We want to see Level 2100 reach ~ 193000 ADC value (5V DAC output signal should see 75% of saturation level)
 
**** Plotting adc0:event shows the 5V signal at 235000 - this is above the 75% window, but it works and we will assume this is a reasonable value for now (see plot for details)
 
** We decide to use the "rampdac12" function in the Prex_ts.crl and database to allow more rapid dynamic range tests and setting multiple gains in a single run
 
*** The ramp goes from 0 to a large value - when that large value gets bigger than 2^12 it wraps back aronud to zero, as one expects
 
*** First channel test - Run 4049 tests ramp function with previously determined optimal gains (int = 3, conv = 3)
 
**** The ramp goes once per cycle (30Hz) in 4 unit increments from 500 to 8000 (according to DAC_MIN12 and DAC_MAX12 variables in Prex_ts.crl file defaults - probably need to change)
 
*** Run 4050 - changing the ramp step size to 16 and made it so one cycle of the Ramp fits into 500 events (set minimum to 500, maximum to 8500- want to be able to set the gains every 1000 events to get consistent plots of ramps vs gain settings
 
**** Works
 
*** Run 4051 - set the gain to lowest settings (int = 3, conv = 0) to see that it still saturates around the Level 4000 mark probably
 
**** Doesn't saturate - converts Level 4000 ~ 10 Volts into 115000 ADC channel (half way to saturation only)
 
*** Run 4052 - set the gain to one we know was already mostly saturated, for Level 500 and higher (int = 2, conv = 10) - should all be saturated, except for when it loops back to zero
 
**** It saturates for ~600 and above, as expected
 
*** Run 4053 skipped
 
*** Run 4054 - set the gain to one value initially, then wait for 2 cycles ~ during 1000-1500 events change the gain to another value (proof of concept that changing gains mid run is possible) and end run at 2500 events
 
**** Works
 
*** Run 4055 - start with maxed maxed (int = 2, conv = 10), next go to medium high (int = 2, conv = 3), go to optimal-previously-decided-medium (int = 3, conv = 3), finish with low (int = 3, conv = 0)
 
**** Works, see plot
 
**** '''We want to have the one where the stripes have the half-way point (Level ~ 2100, Voltage ~ 5V) resting at 193000 ADC channel (75% of saturation level)'''
 
**** Add in a flat bit at the 2100 ~ 5V level for clarity
 
*** Run 4056 - repeat 4055 but with extra flat lines at 2100 Level ~ 5V for clarity
 
**** Error - forgot to reset number of steps counter to 0 after first pass - run again
 
*** Run 4057 - repeat, correct logic mistake
 
**** starts with int = 2, conv = 10
 
**** adc18_setconv(0,3) - medium high
 
**** adc18_intgain(0,3) - just right (int = 3, conv = 3) (actually 20% too high for my taste)
 
**** adc18_setconv(0,0) - too low
 
**** Result - It works (see plot)
 
*** Run 4058 - repeat, use just initial high values and '''int = 3, conv = 2''' for perfect setting 5V at 75% of dynamic range
 
**** '''Result - it works - this is our chosen ADC 0 channel 0 ideal setting'''
 
**** Conv gain = 3 is a bit too high, Conv gain = 2 is a bit too low
 
** Second channel test - 12 bit DAC
 
*** Run 4059 - ramp with kink at 5V - run gains:
 
**** Start with crl set (int = 2, conv = 10), go to (int = 2, conv = 5), go to (int = 3, conv = 4), go to (int = 3, conv = 3), go to (int = 3, conv = 2), end with (int = 3, conv = 0)
 
**** '''Draw("adc1:event") shows that the (int = 3, conv = 2) is the best setting''' and conv = 3 is also fine, but a bit high
 
*** Run 5060 died
 
** Third channel test - 12 bit DAC
 
*** Run 4061 - ramp with kink at 5V - run gains:
 
**** We hard coded a series of 1000 event (not including flat lines at 5V 2100 Level setting) double ramps for specific gain settings (below) - so we don't have to type in the telnet command line and to minimize user error and timing issues (and ideally allow for some scripts later)
 
**** Start with crl set (int = 2, conv = 5), go to (int = 2, conv = 4), go to (int = 3, conv = 4), (int = 3, conv = 3), (int = 3, conv = 2), (int = 3, conv = 0) and do ~ 7000 events to see each setting for 1000 events (2 ramps) and extra ramp on final minimum setting
 
**** Works - adc18->Draw("adc2:event") looks great - '''int = 3, conv = 2 is the ideal setting here'''
 
** Fourth channel test - 12 bit DAC
 
*** Run 4062 - ramp with kink at 5V - run gains (with automated gain setting in .crl script):
 
**** Works - adc18->Draw("adc3:event") looks great - '''int = 3, conv = 2 is the ideal setting here'''
 
* RHRS "adcx19" according to tape label = second ADC, on the right (of two options) of the 18bit ADC crate; address = 1 in ROC26 crate, name = adcx8 in ~/bpan18/pan/control.db
 
** Saturation for all channels occurs at ~ 256000 ADC channels (as expected for a 18 bit board)
 
** First channel test - 12 bit DAC
 
*** Run 4063 - ramp with kink at 5V - run gains (with automated gain setting in .crl script):
 
**** ~/adc18_ana/newrun run# numevents# ROC# ADC# - change ADC# from 0 to 1 to use the second of the 2 ADCs
 
**** Works - adc18->Draw("adc0:event") looks great - '''int = 3, conv = 2 is the ideal setting here''' (this board is almost exactly the same as ADC 0 to the left of it)
 
** Second channel test - 12 bit DAC
 
*** Run 4064 - failed because the CODA run was not properly restarted, meaning that the gain resetting variable was not properly initialized, and the gain was returned to its hardcoded value
 
*** Run 4065 - ramp with kink at 5V - run gains (with automated gain setting in .crl script):
 
**** Works - adc18->Draw("adc1:event") looks great - '''int = 3, conv = 2 is the ideal setting here'''
 
** Third channel test - 12 bit DAC
 
*** Run 4066 - ramp with kink at 5V - run gains (with automated gain setting in .crl script):
 
**** Works - adc18->Draw("adc2:event") looks great - '''int = 3, conv = 2 is the ideal setting here'''
 
** Fourth channel test - 12 bit DAC
 
*** Run 4067 - ramp with kink at 5V - run gains (with automated gain setting in .crl script):
 
**** Works - adc18->Draw("adc3:event") looks great - '''int = 3, conv = 2 is the ideal setting here'''
 
  
 
[[Category:DAQ_Testing]]
 
[[Category:DAQ_Testing]]

Latest revision as of 11:28, 30 July 2018

Back to Main Page >> DAQ Documentation Portal >> DAQ Testing >> DAQ Commissioning Notes

>> Next Day of Testing

July 27th, 2018 Testers: Cameron and Chandan

See Today's Meeting Notes

Goal

Cameron and Chandan learn how to test DAC and ADCs with Bob Michaels

Calibrate RHRS HAPPEX Timing Board (HAPTB ) 12 and 16 bit DAC

To calibrate the 12 and 16 bit DACs we:

  • Log into the RHRS ROC with telnet (see Network Map)
  • Set the DAC output level with the C code command setDACHAPTB(DAC#,Level#)
  • Read the DAC output level with a voltmeter
    • DAC# 1 = 12bit, 2 = 16 bit

Testing RHRS HAPPEX ADCs using 12bit DAC

  • To test an ADC channel
    • Set a specific ADC slot and channel number's gains in the Prex_ts.crl file (in ~/devices/crl/) and make with "makelist Prex_ts.crl ppc"
    • Run through several DAC values and ensure that the base and peak values (adcx#_#_b0 or p0) are not railed to minimum or maximum values
    • Reset the conversion and integrator gain values with functions
      • adc18_intgain(adcModule#,value#) - min = 3, max = 0
      • adc18_setconv(adcModule#,value#) - min = 0, max = 15
      • in Prex_ts.crl around lines 543 and 544 - inside a loop that sets every single ADC channel and gain in all DAQs
      • Set to lower net level first, and scan up
      • to see how high a gain can still read the peak 5V voltage from DAC at ~75% of saturation level
    • We are testing with 30Hz helicity flip rate (longest integration time, most likely to saturate, probably will be used for CREX)
    • Metrics - analyze a run's output with ~/adc18_ana/newrun run# numEvents# roc# slot#
  • RHRS "adcx2" according to tape label = first ADC on the left (of two options) of the 18bit ADC crate; address = 0 in ROC26 crate, name = adcx7 in ~/bpan18/pan/control.db
    • test by logging into HAPPEX7 via telnet and running int and conv gain settings (adcModule#=0) in there while CODA takes data in the background

To Do

  • Test ADCs and continue in todo list
  • Perfect and better justify parameters in Ramp testing function (and separate it out into a specific ramp-testing .crl file to avoid messing with the main Prex_ts.crl functionality)
  • Move the RJ45 cable to a better location on the RHRS, with more slack and less likelihood of getting in the way of other people\
  • Check if something like int = 2 and conv = 0 is actually a more suitable gain setting
  • Understand the nature of "saturation", why signals over 5V are suitable if the gain is low enough, and what non-linearities arise near saturation
  • Put all of the DAQ software into a JeffersonLab repository and track it adequately
  • (JAPAN?) Develop a similar ramping function but to use a constant DAC value and systematically scan the gain settings to understand the linearity, starting points, and relative significance of Integrator and Conversion gains
  • Learn how to tweak and characterize QWeak ADCs (begin with RHRS QWeak ADCs)
  • Do the LHRS, Injector, and Counting House