************** 
Hardware Setup
************** 

Overview
========

FastCCD is a 2-D imaging detector. It can be run in Full-Frame mode (FF, 2 Megapixel, up to 60 Hz) and in Frame-Store mode (FS, 1 Megapixel, up to 120 Hz). Currently, the camera is operated always in FF mode. 

.. The detector is currently installed at SCS as stand-alone detector for single shot non-linear imaging. It may also be used in the future as a secondary diffraction plane for the time-resolved holography in combination with with the DSSC. 

The detector has been developed at Lawrence Berkeley National Laboratory in the U.S. and has been delivered with a DAQ rack. 

As the intensity of the European XFEL beam on the detector may be very high, a central hole for the beam to pass through is required. This hole, 1.8-mm in diameter, was laser-drilled after the sensor was fabricated, bonded and tested. 

The main components of the system are an in-vacuum camera head shown in :numref:`CameraHead`, a camera interface electronics board, and an Advanced Telecommunications Computing Architecture (ATCA) based readout and data processing subsystem.

More information on the performance of the detector can be found in `arXiv:1612.03605 [physics.ins-det] <https://arxiv.org/abs/1612.03605>`_

.. _CameraHead:
    
.. figure:: pics/FastCCD_head.jpeg
    :width: 50 %

    The FastCCD detector head.

+---------------------+--------------------------------+
| Property            | Value                          |
+---------------------+--------------------------------+
| Pixel size          | 30 μm × 30 μm                  |
+---------------------+--------------------------------+
| Sensor thickness    | 200 μm                         |
+---------------------+--------------------------------+
| Dynamic range       | :math:`10^3` above 0.5 keV     |
+---------------------+--------------------------------+
| Sensor size         | 1920 × 960 pixels              |
+---------------------+--------------------------------+
| Photon energy range | 0.25-6 keV                     |
+---------------------+--------------------------------+
| Beam hole size      | 1.8 mm                         |
+---------------------+--------------------------------+
| Quantum efficiency  | :math:`\geq94\%` for Eγ >1 keV |
+---------------------+--------------------------------+
| Speed               | 60 fps (FF), 120 fps (FS)      |
+---------------------+--------------------------------+

The Detector
============

The primary components of the detector include: the camera head with all in-vacuum modules, a vacuum-to-air interface, the backend readout electronics, and auxiliary components like temperature controller, chiller, and power supply.

.. ifconfig:: includeDevInfo in ('true')

    Detector Head
    -------------
    The detector head contains the CCD, and the control and readout electronics. It is mounted on a 60-cm tall bridge (sometimes called "the rocket"). In some configurations a different flange with a shorter 5-cm support is used. 

    A 90-cm cold finger (40 cm in the short configuration) runs trough the center of the bridge and removes the heat from the camera head.

    There are 4 Airborn connectors at the back of the camera head and a slot for the temperature control connector.

    .. figure:: pics/FastCCD_on_support_bridge.jpg
        :width: 10 %

        FastCCD attached to the long support bridge. The long ribbon cables can be seen running on the side.


    .. figure:: pics/FastCCD_data_power_connectors.jpg
            :width: 70 %

            FastCCD installed inside the SCS FFT chamber. The data (top) and power (right) connectors are visible. The beamstop motor is attached to the right of the camera head.

    In-vacuum Cables
    ~~~~~~~~~~~~~~~~
    Five ribbons run along the bridge to the camera head: two for the data readout, one for the clock signals, one providing power and finally the temperature control. Two additional cables control the beam stop motors.

    .. danger::
        The clock and power connectors are identical. The power feedthrough is the one closest to the temperature control feedthrough. If you swap them, you risk burning the camera.

    The Main Flange
    ---------------
    The detector support bridge attaches to a flange that also hosts the feedtroughs. 

    .. figure:: pics/lab_flange.png
        :width: 70 %

        Connection scheme for the flange with the short support.

    .. figure:: pics/beam_flange.png
        :width: 70 %

        Connection scheme for the flange with the long support.

    In-Air Connections
    ------------------
    Optical fibers (FIXME type/connectors...) are used between the Camera Interface Node (CIN) and the new fiber optics modules (sees :numref:`CIN_Figure` and :numref:`CIN_lever`). A separate power supply (see :numref:`Keysight`) is required for these modules.
    
Readout and Control Electronics
===============================
The FastCCD electronics is hosted in a mobile rack that contains:

- an ATCA crate with:

    * the Camera Interface Node (see :numref:`CIN_Figure` and :numref:`CIN_lever`)
    * RAID unit 
    * a control pc
    * an integrated network switch

- a Keithley digital Multimeter (see :numref:`Multimeter`)
- a Lakeshore temperature control unit (see :numref:`Lakeshore`)
- an uninterruptible power supply (see :numref:`Uninterruptible`)
- an Acopian power supply for the camera electronics with a web controlled switch (see :numref:`Acopian`)
- a Keysight power supply for the fiber optics transceivers (see :numref:`Keysight`)
    
.. _CIN_Figure:

.. figure:: pics/IMG_20190410_102039.jpg
    :width: 70%

    The Camera Interface Node (CIN) module is the one where cyan fiber optics cables are connected.

.. _CIN_lever:

.. figure:: pics/IMG_20190410_102231.jpg
    :width: 70%

    The black lever on the right of the module (1) can slide upward to power cycle the CIN. The handle underneath (2) will pop out during this process and needs to be pushed in to be able to restart the module's power.
   
.. _Multimeter:

.. figure:: pics/IMG_20190410_120200.jpg
    :width: 70%

    The Keithley multimeter unit.
    
.. _Lakeshore:

.. figure:: pics/IMG_20190410_120123.jpg
    :width: 70%

    The Lakeshore temperature control unit.
    
.. _Uninterruptible:

.. figure:: pics/UPS.jpg
    :width: 70%

    The uninterruptible power supply.
    
.. _Acopian:

.. figure:: pics/IMG_20190410_101947.jpg
    :width: 70%

    The Acopian power supply. The LEDs on the right side must all be ON (green) when this power supply is ON.   

.. _Keysight:
    
.. figure:: pics/IMG_20190410_120054.jpg
    :width: 50%

    The Keysight power supply for the fiber optics transceivers.

.. ifconfig:: includeDevInfo in ('true')

    The ATCA crate has two separate networks: a 1Gb/s control network, usually called "Base" (192.168.1.*), and a data transfer network, called "Fabric", divided in two 10Gb/s networks: 

    - 10.0.5.* used to transfer raw data from the detector
    - 10.0.6.* used only to access the RAID array

    The ports on the front panel of the ATCA switch can be configured to access these sub-nets, currently:

    - 10.0.5.* can be accessed from the outside using port FIXME 
    - 10.0.6.* can be accessed from the outside using port FIXME 
    - 192.168.1.* can be accessed from the outside using the external switch right under the ATCA crate

.. _CIN:

The Camera Interface Node
-------------------------
The Camera Interface Node (CIN) is an ATCA module connected to the camera head via 6 fiber optics channels (see :numref:`CIN_Figure` and :numref:`CIN_lever`). It provides the control signals for the camera, and reads out and de-scrambles the acquired frames.

.. ifconfig:: includeDevInfo in ('true')

    .. note::
        The CIN sends the frames in large UDP packets, do not forget to configure the network card at the receiving end to accept jumbo frames (set MTU to 9000).

The CIN has a number of LEDs on its front panel that can be used to infer the status of the device.

.. figure:: pics/CIN_LEDs.png
    :width: 70%

    CIN LEDs legend. Some of the unused LEDs are used for debuggiong purposes. 

.. ifconfig:: includeDevInfo in ('true')

    Network Configuration
    ---------------------
        
    +---------------------------+---------------------------+----------------+-----------------------+
    | IP address on 1st sub-net | IP address on 2nd sub-net | Hostname       | notes                 |
    +---------------------------+---------------------------+----------------+-----------------------+
    | 10.0.5.22                 | 10.0.6.22                 |                | ATCA switch console   |
    +---------------------------+---------------------------+----------------+-----------------------+
    | 10.0.5.55                 | 10.0.6.55                 | exflfastccdcin | Blade CPU             |
    +---------------------------+---------------------------+----------------+-----------------------+
    | 10.0.5.123                | 10.0.6.123                |                | RAID                  |
    +---------------------------+---------------------------+----------------+-----------------------+
    | 10.0.5.207                | 10.0.6.207                |                | Camera Interface Node |
    +---------------------------+---------------------------+----------------+-----------------------+
    | 10.0.5.250                | 10.0.6.250                | exflconXXX     | Control server        |
    +---------------------------+---------------------------+----------------+-----------------------+

    +---------------+----------------+------------------------------------+
    | IP address    | Hostname       | notes                              |
    +---------------+----------------+------------------------------------+
    | 192.168.1.2   |                | Acopian Power Supply on/off switch |
    +---------------+----------------+------------------------------------+
    | 192.168.1.3   |                | Keysight Power supply              |
    +---------------+----------------+------------------------------------+
    | 192.168.1.12  |                | Lakeshore 336 (4ch)                |
    +---------------+----------------+------------------------------------+
    | 192.168.1.46  |                | Lakeshore 325 (2ch)                |
    +---------------+----------------+------------------------------------+
    | 192.168.1.47  |                | Keithley 2701 Multimeter           |
    +---------------+----------------+------------------------------------+
    | 192.168.1.55  | exflfastccdcin | Blade CPU                          |
    +---------------+----------------+------------------------------------+
    | 192.168.1.123 |                | RAID                               |
    +---------------+----------------+------------------------------------+
    | 192.168.1.207 |                | Camera Interface Node              |
    +---------------+----------------+------------------------------------+
    | 192.168.1.250 | exflconXXX     | Control server                     |
    +---------------+----------------+------------------------------------+

Cooling System
==============
The detector requires cooling during operation to prevent overheating. 

.. _ChillerSetup:

Chiller Setup
-------------

The CRYOMECH CP830 cryo-chiller is located near the electronics rack. Follow these instructions to turn it on (if you encounter problems, refer to the troubleshooting section):

- make sure that the power is connected and the interlock allows the chiller operation. If this is the case, the red LED on the chiller's front panel (under interlock connector) is on (see :numref:`Chiller_Front` and :numref:`Chiller_Front_zoom`).
- make sure the cooling water valve is open, the valves are on the wall, under one of the network patch panels, look for a green valve marked FastCCD:

    - open the green valve marked FastCCD. 
    - turn the red valve to the right of the green valve anti-clockwise all the way.

- close the circuit breaker (up position is closed) on the chiller front panel. 
- press the large green button on the front panel, the button will lighten up.
- the red LED on the back panel (see :numref:`Chiller_Back`) should turn on and the chiller should make a regular (~1Hz) loud 'chick' noise. If it does not, it means that the compressor is not working (check the troubleshooting section).
- the FastCCD temperature should start decreasing after ~1/2 hour.
- allow for ~3h for the temperature to go down to -28 degC.

.. _Chiller_Front:

.. figure:: pics/CP830_front_panel.png
    :width: 70%

    The front panel of the FastCCD chiller located in the SCS hutch.

.. _Chiller_Front_zoom:

.. figure:: pics/IMG_20190410_101848.jpg
    :width: 70%

    If the power to the chiller is connected and the interlock allows the chiller operation, the red LED on the chiller's front panel (under interlock connector) is on.

.. _Chiller_Back:

.. figure:: pics/IMG_20190410_120033.jpg
    :width: 70%

    The back panel of the FastCCD chiller. The red LED should be on if the compressor is ON and you should hear the chiller's distinguishable chick noise.    

.. DANGER::
   Do not turn the detector off and leave the chiller on unless you have set the Lakeshore according to :numref:`TemperatureStabilisation`. 

Chiller Shutdown
----------------

Follow these instructions to turn the chiller off:

- press the large green button on the front panel.
- the chiller should fall silent and the green light goes off.
- Open the circuit breaker by lowering the handle on the chiller front panel. 

The chiller can also be turned off from the Interlock scene. However, in this case, there is no feedback other than the temperature starting to rise.

.. _LakeshoreTemperatureController:

Lakeshore Temperature Controller
================================

The temperature of the camera is kept stable by two heating resistors (Ohmite 5 W each) installed next to the CCD plane. A PT-100 temperature sensor is installed on the same support.

An additional 100-W heating cartridge is installed near the tip of the copper rod, close to the camera (see :numref:`CameraHead`). A PT-100 is also installed there. This second heater is required to counterbalance the cooling power provided by the Chiller.

.. ifconfig:: includeDevInfo in ('true')

    .. _RodHeater:

    .. figure:: pics/FastCCD-heating-cartridge-1.jpg
        :width: 50 %

        The 100-W heater installed near the tip of the copper rod (see :numref:`RodHeaterCopper`).

    .. _RodHeaterCopper:

    .. figure:: pics/FastCCD-copper-short-rod.jpg
        :width: 15 %

        The 100-W heater is placed on the cylindrical slot visile in this image and near the tip of the copper rod.

The resistors are controlled by a Lakeshore 336 unit, which powers them in a closed feedback loop with a PT-100 in order to reach a specified temperature. 

.. note:: The Lakeshore 336 has several heater settings 0: Off, 1: Low, 2: Medium, 3: High. You should only ever use the High setting (3).

This means that there are three sources of heat in the system:

1. FastCCD itself (0 W when off, ~20 W when on but unbiased, ~30 W when the CCD is biased and the detector is acquiring at 10 Hz)
#. the CCD heater (0-10 W)
#. the rod heater (1-100 W)

Depending on the camera status and desired CCD temperature, the rod heater needs to be set following the table in :numref:`TemperatureStabilisation`.

.. note:: For safety reasons, the Lakeshore unit will turn off all heating loops if the CCD temperature or the rod temperature exceed 20 degC. 

The Lakeshore also provides an alarm signal that will disable the camera power supplies if the CCD temperature is above 0 degC, and disable the chiller if the CCD temperature falls below -60 degC.

.. _Interlock:

Interlock 
---------
A hardware interlock box is connected to the Lakeshore relay output (see :numref:`InterlockBox`). It is designed to cut the power to the two power supplies (camera head and fiber optics transceivers) in case the camera head's temperature exceeds 0 degC. 

A second Lakeshore relay output will cut the chiller power if the camera temperature falls below -60 degC. 

.. _InterlockBox:

.. figure:: pics/IMG_20190410_102440.jpg
    :width: 50 %

    The interlock box can be found at the back of the FastCCD electronics rack in the SCS hutch. This box is connected to the Lakeshore relay output.