``GOTTHARD``: The Gain Optimizing microsTrip sysTem witH Analog ReaDout ----------------------------------------------------------------------- :Author: Laurent Mercadier :Date: 2020-06-11 :Revision: Revision: 1 The Gain Optimizing microsTrip sysTem witH Analog ReaDout, or GOTTHARD, is a 1-D detector developed by `PSI `_ capable of recording 120 frames at 800 kHz (version I) and xxx frames at 4.5 MHz (version II). As of May 2020, SCS owns a GOTTHARD I, which will be exchanged later with two GOTTHARD II. Network / Karabo ++++++++++++++++++ The Gotthard has two Ethernet ports, one for communication with the controller (100Base-T) and one for the receiver (GbE, for DAQ). Two Karabo devices are associated with each detector. A controller, *SCS_PAM_XOX/DET/GOTTHARD_CONTROLx* and a receiver, *SCS_PAM_XOX/DET/GOTTHARD_RECEIVERx*, with *x=1 or 2*. All connections have been prepared by IT, and each pair of controller/receiver devices must have several essential properties set in Karabo for proper operation, as shown below: .. csv-table:: Karabo properties of GOTTHARD_CONTROLx and GOTTHARD_RECEIVERx devices :header: "Device", "Property", "Control/Receiver 1", "Control/Receiver 2" :widths: 20, 30, 40, 40 "Controller", "detectorHostName", "scs-pam-xox-det-gotthard-control1", "scs-pam-xox-det-gotthard-control2" "Controller", "detectorIp", "10.253.13.210", "10.253.13.214" "Controller", "rxHostname", "exflcon176", "exflcon176" "Controller", "rxTcpPort", "same as receiver. Ex: 1954", "same as receiver. Ex: 2954" "Controller", "rxUdpIp", "10.253.13.209", "10.253.13.213" "Controller", "rxUdpPort", "50001", "50002" "Receiver", "rxTcpPort", "same as controller. Ex: 1954", "same as controller. Ex: 2954" Timing / Triggering ++++++++++++++++++++ There are several modes of operation of the detector, here we present the most relevant to record trains of pulses of European XFEL. In the controller device, the extSig0 value should be 'trigger_in_rising_edge', numberOfFrames = 1, numberOfCycles = 1e6 or a very large number, timingMode = 'trigger'. The aim is to match the exposure of the detector (blue areas in Fig. 1) to the pulsed events of the XFEL/Optical Laser (PD signal in Fig. 1). There are 3 signals to monitor on an oscilloscope to reach this goal: 1. The input trigger (green signal in Fig. 1), connected to LEMO connector 1 2. The readout trigger (blue signal in Fig. 1), connected to LEMO connector 2 3. The XFEL/Optical Laser signal via a photodiode (orange signal in Fig. 1) First, we need to send a trigger signal for each frame to record in the train, i.e. a train of 3.3 V LVTTL signal with ~150 ns pulse width. Such a trigger signal is generated by combining a fast trigger (FPGA clock, can operate at up to 4.5 MHz) with a 10 Hz trigger (gate) using a logical AND. This is examplified in Fig. 1.A: the black and the purple signals are combined to create the TRG IN signal that is sent to the Gotthard. The controls on this trigger via Karabo consists of two X2TimerML devices: SCS_PAM_XOX/TSYS/GOTTHARD1_FAST_TRG for FPGA clock and SCS_PAM_XOX/TSYS/GOTTHARD1_GATE for 10 Hz trigger. Now, we are in the situation of Fig. 1.A: The detector exposure is not aligned with the PD signal, 4 pulses instead of 3 are acquired and the exposure time is too short. We can adjust the timing in 4 steps, each of them is shown in Fig. 1.B: 1. Adjust the delay of the GOTTHARD1_GATE trigger to coarsely match the first exposure with the first pulse. 2. Adjust the delay of the GOTTHARD1_FAST_TRG trigger to finely match the exposure with the PD signal. 3. Adjust the duration of the GOTTHARD1_GATE trigger to control the number of pulses to record. 4. Adjust the exposure time of the detector. Note that the order in which these steps are performed is not critical. .. _Gotthard_timing: .. figure:: Images/Gotthard_timing.png :width: 500 Fig. 1: Adjusting the acquisition parameters to record 3 pulses (seen by photodiode). A: parameters wrongly set: the blue area corresponding to the exposure of the detector do not match the PD signal. B: after adjustment in 4 steps, the exposure of the detector matches the PD signal. .. note:: The number of frames set in the RECEIVER device should always match the number of trigger signals per train sent to the detector. Changing the acquisition rep. rate ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The acquisition repetition rate can be changed by adjusting the divider of the FPGA clock in the DOOCS panel (EEE experts only). For example, using a divider of 239 + 1 from the 54.166667 MHz base frequency leads to a rep. rate of 225.6944 kHz, i.e. twice the rep. rate of the OL for 2 mJ/pulse mode. Online Monitoring +++++++++++++++++ .. _EXtra_foam: https://extra-foam.readthedocs.io/en/latest/ .. warning:: EXtra_foam_ is now capable of handling Gotthard detector data and provides more functionalities than those listed below. It is recommended to use it, but it has yet not tested. The Karabo scene for Gotthard looks like this: .. _Gotthard_scene: .. figure:: Images/Gotthard_scene.png :width: 500 The displayed spectrum in the train can be selected by checking the *Online Display* box and entering the frame number to display, on the right side of the spectrum plot. The timing can be controlled in the *Trigger* tab: Gate delay corresponds to step 1, Gate duration to step 3 and Fast Trig. delay to step 2 of the Timing/Triggering section above. The tab *Controls* lists the main properties to act on: - Trigger Mode should be *trigger* - Trigger Delay should remain to [0] s. - Trigger Period should be set to 0.1 s. - Exp. Time controls the step 4 of the above section Timing/Triggering - Exp. Period should be larger than Exp. Time and slightly smaller than the separation between two frames. For instance, when working at 225 kHz, the trigger period should be ~4e-6 s. - # Gates should be set to 0 - # Frames should be set to 1 (1 trigger event is used to record 1 frame) - **# Cycles should be large, ~1e6 or more.** .. warning:: The number of cycles is decremented every time a frame is acquired, and the acquisition stops once it reaches 0. This can easily be unnoticed while recording data!. The number of cycles is reset everytime the acquisition is stopped and started again. The macro GotthardOnline in project *SCS_GOTTHARD* is used to calculate single shot and average spectra of the reflectivity change from a membrane in a pumped / unpumped scheme. The different quantities can be seen with the scene *GotthardOnlineMonitoring*: .. _Gotthard_OnlineMonitoring: .. figure:: Images/OnlineMonitoringGotthard1.png :width: 500 Troubleshooting +++++++++++++++ The Gotthard can be rebooted via: .. code-block:: python telnet scs-pam-xox-det-gotthard-control1 reboot Do same with -control2 If the device server is shutdown and doesn't restart, kill it via: http://exflcon176.desy.de:8080/ Then reinstantiate first the receiver device, then the corresponding control device.