Software for the New General detector Controller (NGC)

21
Software for the Software for the New General detector New General detector Controller (NGC) Controller (NGC) DETECTORS FOR ASTRONOMY DETECTORS FOR ASTRONOMY Garching (Germany), 12-16 October Garching (Germany), 12-16 October 2009 2009 Claudio Cumani / Jörg Claudio Cumani / Jörg Stegmeier Stegmeier

description

Software for the New General detector Controller (NGC). NGC System Overview. NGC LLCU (Linux). 2. 2. 2. 2. 2. 3. 3. 3. 3. 3. Down. Down. Down. Down. Down. Down. Down. Down. NGC LLCU (Linux). AQ. AQ. [N] - ADC. [N] - ADC. [N] - ADC. [N] - ADC. [N] - ADC. - PowerPoint PPT Presentation

Transcript of Software for the New General detector Controller (NGC)

Page 1: Software for the  New General detector Controller (NGC)

Software for the Software for the New General detector New General detector

Controller (NGC)Controller (NGC)

DETECTORS FOR ASTRONOMYDETECTORS FOR ASTRONOMYGarching (Germany), 12-16 October 2009Garching (Germany), 12-16 October 2009 Claudio Cumani / Jörg StegmeierClaudio Cumani / Jörg Stegmeier

Page 2: Software for the  New General detector Controller (NGC)

DetectorDetectorDetectorDetector

FEBFEBFEBFEB

Up

Down

SequencerSequencer

Clock/BiasClock/BiasDriverDriver

4 - ADC4 - ADC

DetectorDetectorDetectorDetector

DetectorDetectorDetectorDetectorDetectorDetectorDetectorDetector

DetectorDetectorDetectorDetectorDetectorDetectorDetectorDetector

Up

Down2 3

[N] - ADC[N] - ADC

Up

Down2 3

[N] - ADC[N] - ADC

Up

Down2 3

[N] - ADC[N] - ADC

Up

Down2 3

[N] - ADC[N] - ADC

Up

Down2 3

[N] - ADC[N] - ADCDetectorDetectorDetectorDetector

DetectorDetectorDetectorDetector

AQAQAQAQ

Up

Down

[N] - ADC[N] - ADC

AQAQAQAQ

Up

Down

[N] - ADC[N] - ADC

NGCNGCLLCU LLCU

(Linux) (Linux)

NGCNGCLLCU LLCU

(Linux) (Linux)

NGC System OverviewNGC System Overview

Shutter-CtrlShutter-Ctrl

LLCU = Linux Local Control UnitLLCU = Linux Local Control Unit

Preamp-CtrlPreamp-Ctrl

22

Page 3: Software for the  New General detector Controller (NGC)

NGCNGCLLCULLCU

(Linux) (Linux)

NGCNGCLLCULLCU

(Linux) (Linux)

IWS IWS (Linux) (Linux)

……

Instrument LANInstrument LANFast Ethernet/Fast Ethernet/

Gigabit-EthernetGigabit-Ethernet

With the current Linux-PC model With the current Linux-PC model we can achieve 200 Mbytes/s we can achieve 200 Mbytes/s

sustained input data-rate with co-adding sustained input data-rate with co-adding (double correlated read-out)(double correlated read-out)

NGC Computing ArchitectureNGC Computing Architecture Programming Language:Programming Language:

C++C++ for control for control processesprocesses

Tcl/TkTcl/Tk for GUI and for GUI and Startup-ScriptsStartup-Scripts

33

Page 4: Software for the  New General detector Controller (NGC)

GoalsGoals One One software basissoftware basis for both optical and infrared for both optical and infrared

applications.applications.

Maximum heritageMaximum heritage of the strength of both IRACE of the strength of both IRACE (infrared predecessor) and FIERA (optical (infrared predecessor) and FIERA (optical predecessor).predecessor).

ModularModular object oriented architecture. object oriented architecture.

ConfigurableConfigurable for all possible system realizations for all possible system realizations (i.e. number of ADC-modules, number of bias-(i.e. number of ADC-modules, number of bias-generators etc.).generators etc.).

Easily programmableEasily programmable clock-pattern generation. clock-pattern generation.

SynchronizationSynchronization with external events. with external events.

Version controlVersion control and and automated testingautomated testing.. 44

Page 5: Software for the  New General detector Controller (NGC)

Config.-FilesConfig.-FilesDatabaseDatabase

FITS-FilesFITS-Files

Control ServerControl Server Real-TimeDisplay

Real-TimeDisplay

Instrument Workstation

Command/Reply

Driver-Interface-ProcessDriver-Interface-Process

Device DriverDevice Driver

NGC LLCU

PCI-Bus Interfac

e

Fiber-Optic-Link to NGC Front End

Data

Commands

Acquisition Process(Pre-Processing, Sorting,…)

Acquisition Process(Pre-Processing, Sorting,…)

GUIGUI

Data-Acquisition-Process(Pre-Processing, Sorting,…)

Data-Acquisition-Process(Pre-Processing, Sorting,…)

Error-SystemError-System

Log-SystemLog-System

The ProcessesThe Processes

55

Page 6: Software for the  New General detector Controller (NGC)

NGC-DCS Control ServerNGC-DCS Control Server The control server can be used as The control server can be used as NGC-HW Control Sub-NGC-HW Control Sub-

SystemSystem of the NGC Optical Software (NGCOSW). That is of the NGC Optical Software (NGCOSW). That is the maximum degree of communality as the same the maximum degree of communality as the same compiled and linked object is used by both applications to compiled and linked object is used by both applications to access the HW. access the HW.

It can be It can be configured at Run-Timeconfigured at Run-Time for the one or the other for the one or the other purpose. purpose.

This is also used as general This is also used as general Engineering ToolEngineering Tool..

Config.-FilesConfig.-FilesDatabaseDatabase

FITS-FilesFITS-Files

Instrument Workstation

Command/Reply

GUIGUIError-SystemError-System

Log-SystemLog-System

Control ServerControl ServerInfrared

Applications

66

Page 7: Software for the  New General detector Controller (NGC)

Controller ProgrammingController Programming The detector voltages are defined in a The detector voltages are defined in a Voltage Voltage

Configuration FileConfiguration File in Short-FITS format ( in Short-FITS format (xxx.vxxx.v).).

Clock-PatternClock-Pattern blocks can be defined both in blocks can be defined both in ASCII-ASCII-Format Format ((xxx.clkxxx.clk) and in a ) and in a Binary FormatBinary Format ( (xxx.bclkxxx.bclk, , output of the output of the Graphical Editing Tool BlueWaveGraphical Editing Tool BlueWave). ). The formats can be converted automatically.The formats can be converted automatically.

SynchronizationSynchronization with external events (e.g. trigger) with external events (e.g. trigger) can be done after any state in any clock-pattern can be done after any state in any clock-pattern block. block.

A A Sequencer Programming LanguageSequencer Programming Language has been has been defined to program the clock-pattern execution.defined to program the clock-pattern execution.

There may be There may be Multiple Sequencer InstancesMultiple Sequencer Instances within within one detector front end system.one detector front end system.

77

Page 8: Software for the  New General detector Controller (NGC)

Clock-Pattern GenerationClock-Pattern Generation The The clock patternclock pattern blocks define sequences of blocks define sequences of clock statesclock states, which , which

are stored in a RAM inside the NGC sequencer hardware.are stored in a RAM inside the NGC sequencer hardware. The bits in the RAM define the state of each physical clock line The bits in the RAM define the state of each physical clock line

plus:plus:

Some control bits (“Some control bits (“wait-for-triggerwait-for-trigger”, “”, “end-of-patternend-of-pattern”).”). The duration of each state (The duration of each state (dwell timedwell time) is defined in the state itself.) is defined in the state itself.

Patterns can be programmed via a Patterns can be programmed via a graphical toolgraphical tool (Bluewave) (Bluewave)

 PATRAM Pattern RAM High Pattern RAM Low… + 0: 00000000000001010001000000000000 00000000000000000000000000000000 State 1… + 1: 00000000000001010001000000000001 00000000000000000000000000000100 State 2… + 2: 00000000000001010001000000000001 00000000000000000000000000000100 State 3 :… +(n-1): 10000000000001010001000000000000 00000000000000000000000000000000 State n

… + n: 00000000000001010001000000000000 00000000000000000000000000000000 State 1… +(n+1): 00000000000001010001000000000001 00000000000000000000000000000100 State 2… +(n+2): 00000000000001010001000000000001 00000000000000000000000000000100 State 3 :… +(n+m-1): 10000000000001010001000000000000 00000000000000000000000000000000 State m

^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 64 60 56 52 48 44 40 36 32 28 24 20 16 12 8 4 1 Clock

Pattern 1

Pattern 2

End of Pattern

88

Page 9: Software for the  New General detector Controller (NGC)

Address : Pattern-RAM HI Pattern-RAM LO BIT [31..0] BIT [31..0]PATRAM+ 0:PATRAM+ 1:PATRAM+ 2:PATRAM+ 3:PATRAM+ 4:PATRAM+ 5:PATRAM+ 6:PATRAM+ 7:PATRAM+ 8:PATRAM+ 9:PATRAM+10:PATRAM+11:PATRAM+12:PATRAM+13:PATRAM+14:PATRAM+15:PATRAM+16:PATRAM+17:PATRAM+18: : :

Clock-PatternBlock 1

Clock-PatternBlock 1

Clock-PatternBlock 2

Clock-PatternBlock 2

Clock-PatternBlock 3

Clock-PatternBlock 3

Clock-PatternBlock 4

Clock-PatternBlock 4

Sequencer ProgrammingSequencer Programming The The sequencer programsequencer program defines the order of execution of defines the order of execution of

the defined clock pattern blocks.the defined clock pattern blocks.

Simple 7-instruction code RAM.Simple 7-instruction code RAM.

Easy to be compiled.Easy to be compiled.

Address : <Instruction> <Rep> <Address> BIT [30..28] [26..11] [10..0]SEQRAM+0: [LOOP] [N] [-]SEQRAM+1: [EXEC] [N] [PATRAM offset]SEQRAM+2: [LOOP] [N] [-]SEQRAM+3: [EXEC] [N] [PATRAM offset]SEQRAM+4: [LOOPEND] [-] [-]SEQRAM+5: [JSR] [-] [SEQRAM offset]SEQRAM+6: [LOOPEND] [-] [-]SEQRAM+7: [EXIT] [-] [-] : :… +offset : [EXEC] [N] [PATRAM offset] … +offset+1: [EXEC] [N] [PATRAM offset] … +offset+2: [RETURN] [-] [-]

[LOOP] = 010 [JSR] = 101 [EXEC] = 001[LOOPINF] = 100 [RETRUN] = 110 [EXIT] = 000[LOOPEND] = 011 99

Page 10: Software for the  New General detector Controller (NGC)

Sequencer Program LanguageSequencer Program Language The sequencer program language is fully driven The sequencer program language is fully driven

by Setup Parameters (e.g. detector integration by Setup Parameters (e.g. detector integration time, number of integrations, window time, number of integrations, window parameters, …).parameters, …).

Support of Support of Arithmetic Expression Evaluation Arithmetic Expression Evaluation (TCL-(TCL-syntax) to derive any program-loop parameter syntax) to derive any program-loop parameter from the setup parametersfrom the setup parameters and to compute and to compute attributes like exposure time estimation and attributes like exposure time estimation and minimum DIT.minimum DIT.

Support of Support of Sub-RoutinesSub-Routines and and Include-FilesInclude-Files to to minimize the code length. minimize the code length.

1010

Page 11: Software for the  New General detector Controller (NGC)

Synchronization points Synchronization points can be inserted at any can be inserted at any place in any clock pattern executed by the place in any clock pattern executed by the sequencer program (i.e. set the “wait-for-trigger” sequencer program (i.e. set the “wait-for-trigger” bit in the particular state). bit in the particular state).

When reaching such a point the pattern execution When reaching such a point the pattern execution is suspended until the arrival of an is suspended until the arrival of an external external trigger signaltrigger signal..

External SynchronizationExternal Synchronization

1111

Page 12: Software for the  New General detector Controller (NGC)

Infrared “Exposures”Infrared “Exposures”

Sustained Detector Read-OutSustained Detector Read-Out and and Video Display Video Display (display remains active during the “(display remains active during the “ExposureExposure”).”).

Sustained Data-TransferSustained Data-Transfer between NGC-LLCU and between NGC-LLCU and Instrument Workstation for application specific Instrument Workstation for application specific Post-Processing Post-Processing (slow control loops, e.g. (slow control loops, e.g. secondary auto-guiding).secondary auto-guiding).

Starting an “Starting an “ExposureExposure” basically means “starting ” basically means “starting to transfer data to disk”.to transfer data to disk”.

Burst-ModeBurst-Mode for fast raw data acquisition. for fast raw data acquisition.

1212

Page 13: Software for the  New General detector Controller (NGC)

Data Acquisiton ProcessesData Acquisiton Processes Multi-threadedMulti-threaded pre-processing framework. pre-processing framework.

High concurrencyHigh concurrency ( (receivereceive, , processprocess, , transfer to transfer to multiple readersmultiple readers, , handle commandhandle command).).

One process per read-out modeOne process per read-out mode guarantees guarantees maximum independency and maximum safety maximum independency and maximum safety ((cannot corrupt working code, releases all cannot corrupt working code, releases all resourcesresources). ).

Template ProcessesTemplate Processes have been developed, which have been developed, which are an easy-to-use and stand-alone tool to are an easy-to-use and stand-alone tool to visualize NGC raw-data on the visualize NGC raw-data on the real-time displayreal-time display..

Standard acquisition processes for the Standard acquisition processes for the ESO ESO Standard IR DetectorsStandard IR Detectors (HAWAII 1Kx1K, HAWAII2-RG (HAWAII 1Kx1K, HAWAII2-RG 2Kx2K, SELEX, AQUARIUS, …) are available within 2Kx2K, SELEX, AQUARIUS, …) are available within the NGC software package. Special setups (e.g. the NGC software package. Special setups (e.g. mosaics) may require special software modules.mosaics) may require special software modules.

1313

Page 14: Software for the  New General detector Controller (NGC)

Frame TypesFrame Types User-definable User-definable Frame-TypesFrame-Types ( (Raw-Sample, Mean-Raw-Sample, Mean-

Value, Standard-Deviation, Half-Chop-Cycle, Value, Standard-Deviation, Half-Chop-Cycle, Intermediate Results…Intermediate Results…). ).

The types can be The types can be selectedselected to be generated/stored to be generated/stored during an exposure.during an exposure.

Exposure Break-ConditionsExposure Break-Conditions can be set per “ can be set per “per per frame-typeframe-type”.”.

Individual SW-WindowsIndividual SW-Windows per frame-type. per frame-type.

1414

Page 15: Software for the  New General detector Controller (NGC)

Data InterfaceData Interface FITS-FilesFITS-Files

Wait for exposure termination and read the Wait for exposure termination and read the generated FITS-file(s).generated FITS-file(s).

Direct connectionDirect connection to Acquisition Process (e.g. to Acquisition Process (e.g. real-time display)real-time display)

Retrieve the binary image data with just minimum Retrieve the binary image data with just minimum header information (dimension, type, sequential header information (dimension, type, sequential number).number).

Post-Processing Call-BackPost-Processing Call-Back

The control server calls a user-defined procedure The control server calls a user-defined procedure before the frame is stored.before the frame is stored.

1515

Page 16: Software for the  New General detector Controller (NGC)

Optical vs. IF NGCOptical vs. IF NGC

Active intervention of the control-server during Active intervention of the control-server during the exposure is required (application of new the exposure is required (application of new voltages in each state “wiping”, “integrating”, voltages in each state “wiping”, “integrating”, “reading”). “reading”).

““Active” interface to different kinds of shutter Active” interface to different kinds of shutter controllers (open/close, status check, open/close controllers (open/close, status check, open/close delays, etc.).delays, etc.).

1616

Page 17: Software for the  New General detector Controller (NGC)

Finite State MachineFinite State Machine

Detector controllers can Detector controllers can be modeled as be modeled as finite finite state machines state machines

i.e.: i.e.:

model of behavior model of behavior composed of a finite composed of a finite number of number of statesstates, , transitionstransitions between between those states, and those states, and actionsactions

1717

Page 18: Software for the  New General detector Controller (NGC)

State Machine - UMLState Machine - UML

Designed using UML Designed using UML (Unified Modeling (Unified Modeling Language)Language)

From this model, From this model, code code can be automatically can be automatically generated!generated!

1818

Page 19: Software for the  New General detector Controller (NGC)

wsfwsf

Code generation tool: ESO Code generation tool: ESO wsf - workstation software wsf - workstation software frameworkframework::

1.1.state design (described by a configuration file)state design (described by a configuration file)

2.2.automatic code generation from state designautomatic code generation from state design

““automatically generated” code handles state automatically generated” code handles state transitions, messages, commands, error conditions, transitions, messages, commands, error conditions, etc. (NOT the actions needed to drive an exposure!)etc. (NOT the actions needed to drive an exposure!)

3.3.implementation of detector control code (CCD, implementation of detector control code (CCD, shutter, etc)shutter, etc)

1919

Page 20: Software for the  New General detector Controller (NGC)

ResultsResults Code dimension: Code dimension:

NGC Base-SW: NGC Base-SW: 220000220000 lines of code (Test SW = 16 lines of code (Test SW = 16 %)%)

NGC IR-SW: NGC IR-SW: 36000 36000 lines of code (Test SW = 12 %) lines of code (Test SW = 12 %) NGC Optical SW:NGC Optical SW: 82000 82000 lines of code (Test SW = 27 lines of code (Test SW = 27

%)%)

Code dimension for optical NGC Code dimension for optical NGC ~~ code dimensions for code dimensions for FIERA controllerFIERA controller

Automatically generated code for optical NGC is Automatically generated code for optical NGC is 78% 78% of the total optical NGC code (without Test SW)of the total optical NGC code (without Test SW)

All NGC software modules are under version control and All NGC software modules are under version control and contain test procedures for automated testing according to contain test procedures for automated testing according to the ESO VLT SOFTWARE standards.the ESO VLT SOFTWARE standards.

2020

Page 21: Software for the  New General detector Controller (NGC)

Goals are achieved…Goals are achieved… One One software basissoftware basis for both optical and infrared for both optical and infrared

applications.applications.

Maximum heritageMaximum heritage of the strength of both IRACE of the strength of both IRACE (infrared predecessor) and FIERA (optical (infrared predecessor) and FIERA (optical predecessor). predecessor).

ModularModular object oriented architecture. object oriented architecture.

ConfigurableConfigurable for all possible system realizations for all possible system realizations (i.e. number of ADC-modules, number of bias-(i.e. number of ADC-modules, number of bias-generators etc.).generators etc.).

Easily programmableEasily programmable clock-pattern generation. clock-pattern generation.

SynchronizationSynchronization with external events. with external events.

Version controlVersion control and and automated testingautomated testing.. 2121