epics-modules / Dante

EPICS module for support of Dante digital pulse processors
1 stars 4 forks source link

Problems with using Dante with Ge detector at APS 13-BM-D beamline #5

Open MarkRivers opened 4 years ago

MarkRivers commented 4 years ago

This issue describes issues we are having with the Dante MCA on the Canberra Ge detector in 13-BM-D. The loaner Dante we tested in August 2019 worked very well with this detector. However, the performance now is poorer.

In both August 2019 and today I compared the Dante to the Canberra AIM MCA electronics. The AIM performance has not changed, but the Dante is worse.

The comparisons were done under the following conditions.

The following screen shots show how the Canberra system was configured. These are the settings that the LVP experiments normally use except that I set the ADC offset to 0 and decreased the fine gain slightly to put the 122 keV Co57 peak a bit further below the end of the spectrum. Pileup reject is enabled, and the shaping time is 2 microsec.

image

image

This is the pre-amp trace with the loaner system in August. The analog offset was set to 230 which put the entire pre-amp ramp within the range of the ADC, as shown in this waveform trace plot. The range is about 4000 to 56000 ADC units, or about 52000 peak to valley.

image

The following screen shows how the Dante system was configured in August 2019. The peaking time and maximum peaking time are both 2 microsec. The gain was set to 2.7 to put the 122 keV Co57 gamma line just below the maximum energy. The firmware is 3.3.13.

image

This is the pre-amp trace from the system today. The range is about 25000 to 56000, or about 31000 peak to valley. Compared to the loaner system the front-end gain is reduced by 31000/52000 = 0.60

image

The following shows the Dante configuration today.

Dante_Ge_Feb25_2020_settings

The major differences in the settings from the loaner system in February are:

This is the IDL MCA plot for the Canberra system (yellow), along with the fitted background and peaks (green). This is the plot from August.

image

This is the plot from today. The main qualitative difference is that the pileup peaks at 44 keV (about 1/3 of maximum energy) are much less sharp than they were in August. Could this be because pileup reject is not working, perhaps a cable is disconnected?

image

This is the IDL MCA plot for the Dante system (yellow), along with the fitted background and peaks (green). This is the plot from August.

image

This is the plot from today. The main differences are that the peak near 0 energy is now much larger than the Ag Ka peak (first blue peak), while in August it was smaller than the Ag Ka peak. The spectrum background is also significantly noiser because there are fewer counts in the 60 seconds of real time.

image

To quantitatively compare the spectra the background and peaks were fit using the following parameters.

image

The peaks fit were:

The energies of all of the peaks except the pileup peaks were fixed, only the 2 global energy calibration coefficients were optimized. For the pile-up peaks the energies were also optimized. The FWHM of each peak was optimized, rather than using a global FWHM fit. The amplitude of each peak was optimized.

The following are the results of the peak fit for the Canberra system measured in August.

*******************************************************
    Fit of 
P:\rivers\Detectors\Dante\BMD Ge Detector\August_2019_reanalyze\Canberra_60s_Ge.dat:1

Real time (seconds):                 60.00
Live time (seconds):                 37.18
Initial FWHM offset, slope:       0.150000  0.000000
Optimized FWHM offset, slope:     0.150000  0.000000
Initial energy offset, slope:     1.123849  0.062181
Optimized energy offset, slope:   1.130285  0.062178
# Iterations, function evals:            0        71
Chi squared:                     2.412295e+008
Status code:                      2
Error message:                  

         Peak       Energy    FWHM      Area     Background   Area/MDL   Area/Bkg

          ag ka    22.104     0.9091*  544086.2    15618.0    1451.2      34.8
          ag kb    24.987     0.9565*  117917.2     9861.0     395.8      12.0
         ag pu1    44.125*    0.9431*    3026.4     1890.0      23.2       1.6
         ag pu2    46.986*    0.9515*    1448.7     1379.0      13.0       1.1
         pb ka1    74.956     0.9376*   15760.3     4406.0      79.1       3.6
         pb ka2    72.794     0.9297*    8949.4     4839.0      42.9       1.8
         pb kb1    84.922     1.1155*    6198.2     7153.0      24.4       0.9
       cd109 g1    88.040     0.9591*   18011.3     5635.0      80.0       3.2
        co57 g2   122.061     0.9467*  102287.1     3160.0     606.5      32.4

The following are the results of the peak fit for the Canberra system measured today. The peak areas, FWHM, and peak/bkg ratios are very similar between August and today except for the pileup peaks.

*******************************************************
    Fit of 13BMD:aim_adc1

Real time (seconds):                 60.00
Live time (seconds):                 44.49
Initial FWHM offset, slope:       0.150000  0.000000
Optimized FWHM offset, slope:     0.150000  0.000000
Initial energy offset, slope:     1.141311  0.062424
Optimized energy offset, slope:   1.161594  0.062398
# Iterations, function evals:            0        94
Chi squared:                     2.019188e+008
Status code:                      2
Error message:                  

         Peak       Energy    FWHM      Area     Background   Area/MDL   Area/Bkg

          ag ka    22.104     0.8889*  564106.8    14999.0    1535.4      37.6
          ag kb    24.987     0.9363*  118706.3    11657.0     366.5      10.2
         ag pu1    43.732*    1.5051*    5032.9     7518.0      19.3       0.7
         ag pu2    46.880*    1.2890*    1117.2     3095.0       6.7       0.4
         pb ka1    74.956     0.9327*   12909.2     3873.0      69.1       3.3
         pb ka2    72.794     0.8729*    7347.8     4016.0      38.6       1.8
         pb kb1    84.922     1.1005*    5312.5     5988.0      22.9       0.9
       cd109 g1    88.040     0.9549*   17692.4     5137.0      82.3       3.4
        co57 g2   122.061     0.9119*   86724.8     3402.0     495.6      25.5

The following are the results of the peak fit for the Dante system measured in August. The peak areas and peak/bkg are significantly better than the Canberra system.

*******************************************************
    Fit of 
P:\rivers\Detectors\Dante\BMD Ge Detector\August_2019_reanalyze\Dante_60s_Ge.dat:1

Real time (seconds):                 60.00
Live time (seconds):                 48.95
Initial FWHM offset, slope:       0.150000  0.000000
Optimized FWHM offset, slope:     0.150000  0.000000
Initial energy offset, slope:    -2.789470  0.063168
Optimized energy offset, slope:  -2.943932  0.064029
# Iterations, function evals:            0       393
Chi squared:                     5.892825e+009
Status code:                      2
Error message:                  

         Peak       Energy    FWHM      Area     Background   Area/MDL   Area/Bkg

          ag ka    22.104     0.8549*  859835.2     8776.0    3059.5      98.0
          ag kb    24.987     0.9358*  191295.8     7640.0     729.5      25.0
         ag pu1    44.201*    0.8245*     753.6     1069.0       7.7       0.7
         ag pu2    47.231*    1.1062*     295.1     1116.0       2.9       0.3
         pb ka1    74.956     0.8709*   23070.7     4147.0     119.4       5.6
         pb ka2    72.794     0.8614*   12775.2     4281.0      65.1       3.0
         pb kb1    84.922     1.1314*    8661.6     6546.0      35.7       1.3
       cd109 g1    88.040     0.9334*   24821.5     5498.0     111.6       4.5
        co57 g2   122.061     0.9535*  105757.7     1904.0     807.9      55.5

The following are the results of the peak fit for the Dante system measured today. The peak areas are 3-4 times smaller than in August and are now about 2X less than the Canberra. The peak/bkg ratios are 2X less than measured in August. The live time is 3X less.

*******************************************************
    Fit of 13BMD_Dante1:mca1

Real time (seconds):                 60.00
Live time (seconds):                 15.53
Initial FWHM offset, slope:       0.150000  0.000000
Optimized FWHM offset, slope:     0.150000  0.000000
Initial energy offset, slope:    -2.789470  0.063168
Optimized energy offset, slope:  -2.780557  0.063140
# Iterations, function evals:            0        71
Chi squared:                     4.411163e+010
Status code:                      2
Error message:                  
         Peak       Energy    FWHM      Area     Background   Area/MDL   Area/Bkg

          ag ka    22.104     0.8687*  228768.4     4316.0    1160.7      53.0
          ag kb    24.987     0.9252*   49230.7     3256.0     287.6      15.1
         ag pu1    44.259*    0.9930*     374.1      371.0       6.5       1.0
         ag pu2    47.050*    0.6690*     115.1      216.0       2.6       0.5
         pb ka1    74.956     0.8527*    5285.9     1333.0      48.3       4.0
         pb ka2    72.794     0.8471*    2965.7     1361.0      26.8       2.2
         pb kb1    84.922     0.9684*    1738.7     1899.0      13.3       0.9
       cd109 g1    88.040     0.9220*    7373.2     1595.0      61.5       4.6
        co57 g2   122.061     0.9605*   36943.5      835.0     426.2      44.2

To try to understand why the zero energy peak and ICR are so much larger now than in August I collected an ADC trace with the fastest sampling time, and zoomed in on a single 22 keV x-ray pulse.

image

There is clearly a noise source present. Unfortunately I did not save an ADC trace from August to see if this noise source was also present then. The noise has a peak to peak amplitude of about 50 ADC units. It repeats 6 times in 30 microseconds, so the period is about 5 microseconds, which is about 200 kHz.

Is this what is causing the large 0 energy peak and large ICR?

Would that be reducing the throughput so it is now 2X less than the Canberra, and 3-4 times less than the Dante measured in August?

MarkRivers commented 4 years ago

Luca Bombelli from XGLab agreed that the noise seen in the ADC trace is the source of the problems. He suggested increasing the Fast threshold to eliminate zero energy the peak. I found that I needed to increase it to 18 keV (284 MCA bins) to eliminate it. Once I did that the ICR and OCR were nearly the same and the zero energy peak was drastically reduced.

I repeated the measurements. For logistical reasons I used older Cd109 and Co57 sources (2015 vs 2019) so the count rates are less.

I also increased the Peaking time and Max Peaking Time on the Dante from 2 microseconds each to 4 and 6 microseconds respectively.

image

This is the Dante configuration reported by the driver:

epics> asynReport 1 DANTE1
DANTE1 multiDevice:Yes canBlock:Yes autoConnect:Yes
    enabled:Yes connected:Yes numberConnects 1
    nDevices 1 nQueued 0 blocked:No
    asynManagerLock:No synchronousLock:No
    exceptionActive:No exceptionUsers 0 exceptionNotifys 0
    traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
    addr 0 autoConnect Yes enabled Yes connected Yes exceptionActive No
        exceptionActive No exceptionUsers 1 exceptionNotifys 0
        blocked No
        traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
Configuration 0:
      fast_filter_thr: 284
    energy_filter_thr: 63
  energy_baseline_thr: 63
         max_risetime: 87.000000
                 gain: 4.400000
         peaking_time: 125
     max_peaking_time: 187
             flat_top: 6
    edge_peaking_time: 31
        edge_flat_top: 6
  reset_recovery_time: 625
       zero_peak_freq: 0.010000
     baseline_samples: 64
       inverted_input: 0
        time_constant: 0.000000
          base_offset: 0
    overflow_recovery: 0
      reset_threshold: 0
     tail_coefficient: 0.000000
Statistics 0:
            real_time: 60000000.000000
            live_time: 57654776.000000
                  ICR: 4.664349
                  OCR: 4.482033
       last_timestamp: 60000000.000000
             detected: 282617
             measured: 268922
              edge_dt: 27545
             filt1_dt: 586306
           zerocounts: 572
      baselines_value: 26999628
            pup_value: 888
         pup_f1_value: 13723
      pup_notf1_value: 0
  reset_counter_value: 1954

This is the Canberra MCA plot now with the weaker sources.

image

This is the Dante plot

image

This is the fit of the Canberra spectrum:

*******************************************************
    Fit of 13BMD:aim_adc1

Real time (seconds):                 60.00
Live time (seconds):                 56.98
Initial FWHM offset, slope:       0.150000  0.000000
Optimized FWHM offset, slope:     0.150000  0.000000
Initial energy offset, slope:     1.141311  0.062424
Optimized energy offset, slope:   1.141765  0.062402
# Iterations, function evals:            0        71
Chi squared:                     1.145288e+007
Status code:                      2
Error message:                  

         Peak       Energy    FWHM      Area     Background   Area/MDL   Area/Bkg

          ag ka    22.104     0.8118*  166995.6     2870.0    1039.1      58.2
          ag kb    24.987     0.8565*   35357.2     1854.0     273.7      19.1
         ag pu1    43.656*    2.1363*     207.5      409.0       3.4       0.5
         ag pu2    47.122*    1.8737*      46.2      150.0       1.3       0.3
         pb ka1    74.956     0.8503*     543.3      329.0      10.0       1.7
         pb ka2    72.794     0.7645*     295.8      287.0       5.8       1.0
         pb kb1    84.922     1.0052*     153.7      374.0       2.6       0.4
       cd109 g1    88.040     0.8371*    5198.7      362.0      91.1      14.4
        co57 g2   122.061     0.8462*    4807.0      241.0     103.2      19.9

This is the fit for the Dante:

*******************************************************
    Fit of 13BMD_Dante1:mca1

Real time (seconds):                 60.00
Live time (seconds):                 57.65
Initial FWHM offset, slope:       0.150000  0.000000
Optimized FWHM offset, slope:     0.150000  0.000000
Initial energy offset, slope:    -2.789470  0.063168
Optimized energy offset, slope:  -2.988031  0.063529
# Iterations, function evals:            0       141
Chi squared:                     2.109271e+007
Status code:                      2
Error message:                  

         Peak       Energy    FWHM      Area     Background   Area/MDL   Area/Bkg

          ag ka    22.104     0.6661*  169465.2     2182.0    1209.3      77.7
          ag kb    24.987     0.7257*   36069.6     1352.0     327.0      26.7
         ag pu1    44.259*    0.4358*      52.2       29.0       3.2       1.8
         ag pu2    47.294*    0.9748*      26.4       57.0       1.2       0.5
         pb ka1    74.956     0.6361*     548.0      203.0      12.8       2.7
         pb ka2    72.794     0.6727*     288.7      215.0       6.6       1.3
         pb kb1    84.922     0.9198*     211.6      226.0       4.7       0.9
       cd109 g1    88.040     0.6806*    5204.6      252.0     109.3      20.7
        co57 g2   122.061     0.7301*    5077.5      115.0     157.8      44.2

Now the Dante has slightly better throughput than the Canberra, significantly better Area/Bkg, and significantly better FWHM.

MarkRivers commented 4 years ago

The source of the ~200 kHz noise was found and fixed. The problem was the power 12V power supply we were using the run the Dante. The power supplies originally shipped with the Dante single-channel units had the incorrect (European) power plug, so we used another power supply we already had. XGLab sent us the correct power supplies, but we neglected to switch to the XGLab power supply in 13-BM-D. When we did switch to their power supply the problem went away.

Before finding that this was the problem I tried the following:

None of the above steps reduced the noise significantly. It generally looked like this, with 100 A/D units peak/peak and 7 cycles/40 microseconds = 175 kHz. image

After replacing the power supply the trace generally looked like this: image

Every once in a while there was a small amount of noise at a different frequency from that observed previously with the other power supply. This is about 75 A/D units at 40 kHz. It is mostly not present, but seems to come and go.

image

MarkRivers commented 4 years ago

After replacing the power supply I was able to reduce the FastThreshold from 18 keV to 4.5 keV before the ICR and low energy peak increased significantly. image

These are the Dante settings now:

Configuration 0:
      fast_filter_thr: 71
    energy_filter_thr: 63
  energy_baseline_thr: 63
         max_risetime: 87.000000
                 gain: 4.400000
         peaking_time: 125
     max_peaking_time: 187
             flat_top: 6
    edge_peaking_time: 31
        edge_flat_top: 6
  reset_recovery_time: 625
       zero_peak_freq: 0.010000
     baseline_samples: 64
       inverted_input: 0
        time_constant: 0.000000
          base_offset: 0
    overflow_recovery: 0
      reset_threshold: 0
     tail_coefficient: 0.000000
Statistics 0:
            real_time: 60000000.000000
            live_time: 57464816.000000
                  ICR: 5.068928
                  OCR: 4.854750
       last_timestamp: 60000000.000000
             detected: 306090
             measured: 291285
              edge_dt: 48333
             filt1_dt: 633796
           zerocounts: 570
      baselines_value: 26945746
            pup_value: 1037
         pup_f1_value: 14835
      pup_notf1_value: 0
  reset_counter_value: 1825

With these settings I compared the Canberra and the Dante again.

This is the Canberra spectrum now: image

This is the Dante spectrum now: image

This is the fit of the Canberra spectrum:

*******************************************************
    Fit of 13BMD:aim_adc1

Real time (seconds):                 60.00
Live time (seconds):                 56.43
Initial FWHM offset, slope:       0.150000  0.000000
Optimized FWHM offset, slope:     0.150000  0.000000
Initial energy offset, slope:     1.141311  0.062424
Optimized energy offset, slope:   1.051058  0.062505
# Iterations, function evals:            0        94
Chi squared:                     1.047906e+007
Status code:                      2
Error message:                  

         Peak       Energy    FWHM      Area     Background   Area/MDL   Area/Bkg

          ag ka    22.104     0.8163*  160844.1     2717.0    1028.6      59.2
          ag kb    24.987     0.8531*   34338.4     1773.0     271.8      19.4
         ag pu1    44.110*    0.7364*     111.4      121.0       3.4       0.9
         ag pu2    47.190*    2.0244*      70.3      117.0       2.2       0.6
         pb ka1    74.956     0.9221*     506.2      299.0       9.8       1.7
         pb ka2    72.794     0.8132*     281.0      320.0       5.2       0.9
         pb kb1    84.922     1.1836*     175.9      353.0       3.1       0.5
       cd109 g1    88.040     0.8407*    4907.8      345.0      88.1      14.2
        co57 g2   122.061     0.8313*    4672.7      242.0     100.1      19.3

This is the fit of the Dante spectrum:

*******************************************************
    Fit of 13BMD_Dante1:mca1

Real time (seconds):                 60.00
Live time (seconds):                 57.46
Initial FWHM offset, slope:       0.150000  0.000000
Optimized FWHM offset, slope:     0.150000  0.000000
Initial energy offset, slope:    -2.789470  0.063168
Optimized energy offset, slope:  -3.000861  0.063457
# Iterations, function evals:            0        94
Chi squared:                     6.475848e+007
Status code:                      2
Error message:                  

         Peak       Energy    FWHM      Area     Background   Area/MDL   Area/Bkg

          ag ka    22.104     0.6419*  162307.7     2353.0    1115.3      69.0
          ag kb    24.987     0.7032*   35129.7     1568.0     295.7      22.4
         ag pu1    44.207*    0.6335*      40.9       68.0       1.7       0.6
         ag pu2    46.990*    0.7439*      25.7       30.0       1.6       0.9
         pb ka1    74.956     0.6288*     547.0      205.0      12.7       2.7
         pb ka2    72.794     0.6519*     318.8      197.0       7.6       1.6
         pb kb1    84.922     0.9273*     140.8      299.0       2.7       0.5
       cd109 g1    88.040     0.6737*    5140.1      252.0     107.9      20.4
        co57 g2   122.061     0.7190*    4776.9      129.0     140.2      37.0

So the Dante peak/background and the FWHM are both better than the Canberra.