You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/afe.rst
+23-28Lines changed: 23 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,7 @@ The exercises are grouped into three parts. In the first part the basic function
165
165
166
166
The exercise 0 contains preparatory questions that should be answered before coming to the lab.
167
167
168
-
.. admonition:: Pre-lab questions
168
+
.. admonition:: Exercise 0: Pre-lab questions
169
169
170
170
Please answer the following questions before lab:
171
171
@@ -177,43 +177,38 @@ Please answer the following questions before lab:
177
177
#. The threshold of the comparator should be set in a way that the noise is suppressed and only the signals are detected. What would happen if the threshold was too low, what would happen if it was too high? How could the terms purity and efficiency of the detection process be defined in this context? What happens if baseline and signal fluctuations are getting too close to each other?
178
178
#. The term 'equivalent-noise-charge' (ENC) expresses the voltage noise in a measured output signal, in terms of the equivalent input charge that would produce it. Given the charge sensitivity we calculated above, what would be the ENC for a measured 10mV output noise amplitude?
179
179
#. How are the discriminating comparator's Gaussian distribution and the error-function related? How can one extract the width (sigma) and the mean (lambda) of the underlying Gaussian distribution from a measured error function? How is the noise calculated from the slope of the error function at the 50 % point?
180
+
#. Draw a sketch of an amplitude histogram of an ideal noise-free system. It consist of two delta-like peaks: one for the baseline and one for the signal amplitude produced by a constant input charge. In a real system, however, noise is overlaying the ideal signals, leading to fluctuations of the baseline and signal amplitudes. Modify the amplitude histogram to reflect these fluctuations (assume a Gaussian distribution of the noise).
181
+
#. Draw an optimum threshold in your amplitude histogram.
182
+
#. The term 'equivalent-noise-charge' (ENC) represents the quantity of electrons at the input of an ideal (i.e. noise-free) signal chain that would produce the same amplitude at the output as the noise alone would in a real system. What is the ENC value for a noise amplitude of 10 mV given the charge sensitivity calculated above?
180
183
181
-
#. Draw a sketch of an amplitude histogram of an ideal noise-free system. It consist of two delta-like peaks: one for the baseline and one for the signal amplitude produced by a constant input charge. In a real system, however, noise is overlaying the ideal signals, leading to fluctuations of the baseline and signal amplitudes. Modify the amplitude histogram to reflect these fluctuations (assume a Gaussian distribution of the noise).
182
-
Q6: Draw an optimum threshold in your amplitude histogram.
183
-
Q7 #. The term 'equivalent-noise-charge' (ENC) represents the quantity of electrons at the input of an ideal (i.e. noise-free) signal chain that would produce the same amplitude at the output as the noise alone would in a real system. What is the ENC value for a noise amplitude of 10 mV given the charge sensitivity calculated above?
184
-
.. Q10 #. Advanced tasks: Calculate and plot the time-over-threshold as a function of the ratio of CR-RC shaper peak amplitude and threshold voltage. You can do that either by inverting the mathematical expression for the shaper pulse waveform (-> Lambert W function) or by implementing a function representing the shaper pulse waveform in Python and numerically evaluating TOT width for a range of amplitude values at a fixed threshold. Note: this function will be useful to fit measured pulse waveforms (see the later exercises). What is the relation between the TOT and the injected charge? What is the effect of the shaping time constant on the TOT? Assume the TOT counter has a resolution of 25 ns and a maximum count of 255. What is the maximum detectable TOT width in this case? Assume the maximum amplitude to threshold ratio is 10. What is the maximum shaping time constant that can be used in this case?
184
+
.. admonition:: Exercise 1. Characterizing an analog front-end
185
185
186
+
The first set of exercises is intended to familiarize you with the analog front-end hardware and the control software. The goal is to observe the different signals of the analog front-end chain (CSA, SHA, COMP) and to understand the effect of the different circuit parameters on the signal shape. To monitor the signal waveform, connect an oscilloscope to the LEMO socket **OUTPUT**. Use the jumper bank in front of the LEMO socket to select the signal to be monitored manually (**CSA, HPF, SHA, COMP**) or use the setting **MUX** to select the signal to be monitored via your program code with the **SPI** interface. Note: As mentioned in the circuit description above, the shaper circuit adds a total gain of 1000 to the CSA output signal. This gain is split in three gain stages with G=10 that are distributed along the signal chain in front of the **CSA**, the **HPF**, and the **SHA** output, respectively. The **CSA** output is amplified by 10, the **HPF** accumulated amplification is 100 and the shaper output **SHA** finally accumulates the total gain of 1000.
186
187
187
-
.. admonition:: Exercises
188
-
189
-
#. Make a small table of DAC values for VINJ vs. peak voltages measured after the shaping amplifier.
190
-
#. Implement a scan routine to measure the s-curve of the system. The s-curve is obtained by measuring the hit probability as a function of the injected charge. The charge is varied by changing the injection voltage. The hit probability is calculated by counting the number of hits (using the comparator output pulse) for a given charge step in relation to the total number of injections. Be sure to convert the x-axis of the s-curve from DAC units to charge units (in electrons) **Note:** The effective value of the feedback capacitance is :math:`C_{f}^{eff} = 1.39 pF` due to the parasitic capacitance of the PCB traces and the feedback resistor which add to the nominal value :math:`C_{f} = 1.0 pF`
191
-
#. Acquire s-curves for different shaping time constants. What is the effect of the shaping time on the noise? (Do not yet connect a sensor diode to the CSA, as we just want characterize the AFE circuit in isolation.)
192
-
193
-
.. admonition:: Exercise 1. Waveform measurements
188
+
Once you are familiar with the signal generation and monitoring, switch from the external oscilloscope to the fast ADC on the Raspberry Pi base board to record and save the waveform data for further analysis. Connect the monitor signal to the **ADC** input on the base board and set the gain jumper to **1**. The trigger for the waveform acquisition should be derived from the charge injection signal. To select this trigger source set the **TRG** jumper to **GPIO4**. The fast ADC is controlled by a Python script ``osc.py`` which can be found in the folder ``FAST_ADC``. The script needs root privileges to access the interface to the fast ADC and thus has to be started by calling ``sudo -E python osc.py``. A simple command line interface of the ``osc.py`` tool will allow you to set the horizontal resolution and the saving of acquired waveform data to file (csv) or to save a waveform image (png).
194
189
195
-
.. This exercise is intended to familiarize you with the analog front-end hardware and the control software. The goal is to observe the different signals of the analog front-end chain (CSA, SHA, COMP) and to understand the effect of the different circuit parameters on the signal shape. To monitor the signal waveform, connect an oscilloscope to the LEMO socket **OUTPUT**. Use the jumper bank in front of the LEMO socket to select the signal to be monitored manually (**CSA, HPF, SHA, COMP**) or use the setting **MUX** to select the signal to be monitored via your program code with the **SPI** interface. Note: As mentioned in the circuit description above, the shaper circuit adds a total gain of 1000 to the CSA output signal. This gain is split in three gain stages with G=10 that are distributed along the signal chain in front of the **CSA**, the **HPF**, and the **SHA** output, respectively. The **CSA** output is amplified by 10, the **HPF** accumulated amplification is 100 and the shaper output **SHA** finally accumulates the total gain of 1000.
190
+
After reading the above, answer the following questions in your lab report:
196
191
197
-
.. Once you are familiar with the signal generation and monitoring switch from the external oscilloscope to the fast ADC on the Raspberry Pi base board to record and save the waveform data for further analysis. Connect the monitor signal to the **ADC** input on the base board and set the gain jumper to **1**. The trigger for the waveform acquisition should be derived from the charge injection signal. To select this trigger source set the **TRG** jumper to **GPIO4**. The fast ADC is controlled by a Python script ``osc.py`` which can be found in the folder ``FAST_ADC``. The script needs root privileges to access the interface to the fast ADC and thus has to be started by calling ``sudo -E python osc.py``. A simple command line interface of the ``osc.py`` tool will allow you to set the horizontal resolution and the saving of acquired waveform data to file (csv) or to save a waveform image (png).
192
+
#. A negative charge is injected with the rising edge of the **INJ** signal, which will generate a positive amplitude at the **CSA**, **HPF**, and **SHA** outputs. What happens at the falling edge of the **INJ** signal? What happens if the time delay between the rising and the falling injection signal is too short? What circuit parameters do you have to take into account to estimate the maximum injection frequency?
193
+
#. Implement a routine to continuously inject charge pulses into the CSA and observe the different signals (**CSA**, high-pass filter **HPF**, shaper **SHA**, and comparator **COMP**) while varying the injected charge amplitude, shaper time constants, and comparator threshold. To get a reasonable comparator response, the threshold needs to be set in a range between the baseline of the signal and the pulse peak amplitude (remember the LSB step size of the threshold DAC is 0.5 mV). Advanced: You could use threading to change configuration parameters to avoid needing to stop, modify and restart your injecting loop script (see ``threads.py`` as an example for using threads in Python).
194
+
#. Make a small table of DAC values for VINJ vs. peak voltages measured after the shaping amplifier. Also calculate which VTHR DAC value would be just able to still discriminate this signal. The table will be useful for setting reasonable parameters in later exercises.
195
+
#. Select an injection amplitude that is well within the dynamic range of the system (i.e. no amplitude clipping but also well above the noise floor). Sample the **SHA** output with the fast ADC and save the waveforms to file for each time constant setting of the shaper. Write a script that can read and plot the saved waveform data (CSV format). Add a fitting function to the pulse shape (assume an ideal CR-RC pulse shape with equivalent time constants for low and high pass filter) and extract the peaking time and peak amplitude for each shaper setting. Does the peak amplitude change with the peaking time? Give possible explanations. Optional: Implement a fitting function for the shaper pulse with independent time constants for high and low pass filter.
196
+
#. **Advanced task: (Not mandatory, only attempt if time permits)** Calculate and plot the time-over-threshold as a function of the ratio of CR-RC shaper peak amplitude and threshold voltage. You can do that either by inverting the mathematical expression for the shaper pulse waveform (-> Lambert W function) or by implementing a function representing the shaper pulse waveform in Python and numerically evaluating TOT width for a range of amplitude values at a fixed threshold. Note: this function will be useful to fit measured pulse waveforms (see the later exercises). What is the relation between the TOT and the injected charge? What is the effect of the shaping time constant on the TOT? Assume the TOT counter has a resolution of 25 ns and a maximum count of 255. What is the maximum detectable TOT width in this case? Assume the maximum amplitude to threshold ratio is 10. What is the maximum shaping time constant that can be used in this case?
198
197
199
198
200
-
.. #. A negative charge is injected with the rising edge of the **INJ** signal, which will generate a positive amplitude at the **CSA**, **HPF**, and **SHA** outputs. What happens at the falling edge of the **INJ** signal? What happens if the time delay between the rising and the falling injection signal is too short? What circuit parameters do you have to take into account to estimate the maximum injection frequency?
201
-
.. #. Implement a script to continuously inject charge pulses into the CSA and observe the different signals (**CSA**, high-pass filter **HPF**, shaper **SHA**, and comparator **COMP**) while varying the injected charge amplitude, shaper time constants, and comparator threshold. To get a reasonable comparator response, the threshold needs to be set in a range between the baseline of the signal and the pulse peak amplitude (remember the LSB step size of the threshold DAC is 0.5 mV). Advanced: You could use threading to change configuration parameters to avoid needing to stop, modify and restart your injecting loop script (see ``threads.py`` as an example for using threads in Python).
202
-
.. #. Make a small table of DAC values for VINJ vs. peak voltages measured after the shaping amplifier. Also calculate which VTHR DAC value would be just able to still discriminate this signal. The table will be useful for setting reasonable parameters in later exercises.
203
-
.. #. Select an injection amplitude that is well within the dynamic range of the system (i.e. no amplitude clipping but also well above the noise floor). Sample the **SHA** output with the fast ADC and save the waveforms to file for each time constant setting of the shaper. Write a script that can read and plot the saved waveform data (CSV format). Add a fitting function to the pulse shape (assume an ideal CR-RC pulse shape with equivalent time constants for low and high pass filter) and extract the peaking time and peak amplitude for each shaper setting. Does the peak amplitude change with the peaking time? Give possible explanations. Optional: Implement a fitting function for the shaper pulse with independent time constants for high and low pass filter.
199
+
.. admonition:: Exercise 2. Characterizating a digital read-out
204
200
201
+
In this section, we will understand the behavior of the logic which quantizers and records the hit information in a digital manner. Please answer the following questions in your report:
205
202
206
-
.. .. admonition:: Exercise 2. Characterization with the digital read-out
207
-
208
-
.. #. Now select the comparator output with the monitor multiplexer. Set a threshold at half of the shaper peak amplitude (the **Vthr** DAC gain is 0.5 mV/DAC step). Observe the pulse width of the comparator output (time-over-threshold, TOT) for different injection amplitudes with an oscilloscope or the ``osc.py`` application. What relation between TOT and injected charge would you expect? Measure (by hand) the average TOT value for 5-10 different input charge values. An automated TOT measurement using the hit signal to start and stop a digital timer will be implemented later with the FPGA lab module.
209
-
.. #. Implement a scan routine to measure the s-curve of the system. The s-curve is obtained by measuring the hit probability as a function of the injected charge. The charge is varied by changing the injection voltage. The hit probability is calculated by counting the number of hits (using the comparator output pulse) for a given charge step in relation to the total number of injections. Convert the x-axis of the s-curve from DAC units to charge units using the calibration factor of the injection circuit calculated above (in electrons) **Note:** The effective value of the feedback capacitance is :math:`C_{f}^{eff} = 1.39 pF` due to the parasitic capacitance of the PCB traces and the feedback resistor which add to the nominal value :math:`C_{f} = 1.0 pF`
210
-
.. #. Use the measured s-curve to extract the threshold (50 % value) and the noise (proportional to 1/slope at the 50 % point). Repeat for different threshold settings. Does the change of the measured threshold (in injection charge units) correspond to the change of the threshold DAC setting in threshold charge units (both in electrons) as you have calculated above? How large is the deviation?
203
+
#. First, select the comparator output with the monitor multiplexer. Set a threshold at half of the shaper peak amplitude (the **Vthr** DAC gain is 0.5 mV/DAC step). Observe the pulse width of the comparator output (time-over-threshold, TOT) for different injection amplitudes with an oscilloscope or the ``osc.py`` application. What relation between TOT and injected charge would you expect? Measure (by hand) the average TOT value for 5-10 different input charge values. An automated TOT measurement using the hit signal to start and stop a digital timer will be implemented later with the FPGA lab module.
204
+
#. Implement a scan routine to measure the s-curve of the system. The s-curve is obtained by measuring the hit probability as a function of the injected charge. The charge is varied by changing the injection voltage. The hit probability is calculated by counting the number of hits (using the comparator output pulse) for a given charge step in relation to the total number of injections. Be sure to convert the x-axis of the s-curve from DAC units to charge units (in electrons) **Note:** The effective value of the feedback capacitance is :math:`C_{f}^{eff} = 1.39 pF` due to the parasitic capacitance of the PCB traces and the feedback resistor which add to the nominal value :math:`C_{f} = 1.0 pF`
205
+
#. Use the measured s-curve to extract the threshold (50 % value) and the noise (proportional to 1/slope at the 50 % point). Repeat for different threshold settings. Does the change of the measured threshold (in injection charge units) correspond to the change of the threshold DAC setting in threshold charge units (both in electrons) as you have calculated above? How large is the deviation?
.. admonition:: Exercise 3. Noise performance of complete
214
209
215
-
.. #. Acquire s-curves for different shaping time constants. What is the effect of the shaping time on the noise? Do not yet connect a sensor diode to the CSA.
216
-
.. #. Now connect a sensor diode to the CSA and apply 20 V bias voltage. Repeat the s-curves measurements. What happens if you lower the bias voltage? What is the effect of the detector capacitance on the noise performance?
217
-
.. #. Connect various test capacitors instead of the sensor diode and plot the noise vs. input capacitance. Repeat the measurements for different shaping time constants.
210
+
Finally, we will understand the performance of the system in aggregate. Noise plays a critical role, as you have read in the pre-lab questions:
218
211
219
-
212
+
#. Acquire s-curves for different shaping time constants. What is the effect of the shaping time on the noise? (Do not connect a sensor diode to the CSA during this step, as we just want characterize the AFE circuit in isolation.)
213
+
#. Now connect a sensor diode to the CSA and apply 20 V bias voltage. Repeat the s-curves measurements. What happens if you lower the bias voltage? What is the effect of the detector capacitance on the noise performance?
214
+
#. Connect various test capacitors instead of the sensor diode and plot the noise vs. input capacitance. Repeat the measurements for different shaping time constants.
0 commit comments