FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for...

34
FLASH Control System Overview A selective overview of the FLASH control system for operators Tim Wilksen FLASH Control System Overview Hamburg, 14.07.2017

Transcript of FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for...

Page 1: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

FLASH Control System Overview A selective overview of the FLASH control system for operators

Tim Wilksen FLASH Control System Overview Hamburg, 14.07.2017

Page 2: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 2

Outline

>  Essentials

>  Tools

>  Data Acquisition System

>  Some Hints On Failure Detection

Page 3: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 3

Essentials

> Essentials § Concepts § System Layout § Server

Page 4: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 4

Essentials – Basic Concepts

>  Designed 20 years ago with focus on operating accelerator facilities

>  The basic entity is a device server representing a (hardware) device

>  Object-oriented design paradigm where a device is an instance of an object-oriented class

>  Server holds several device instances as locations

>  Device instance contains the properties of a (hardware) device

>  Properties are data objects and access points on the communication network

>  Device definition and configuration is done on server only and transparent to the communication network therefore enabling a distributed architecture

>  Control system or device properties are called DOOCS Server Properties

>  The naming scheme adheres to a four-string identifier

Facility/Device/Location/Property

Page 5: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 5

Essentials – Control System Design

Timing & Synchronization Bus

Feedback Bus

Network (soft real time)

Network (general purpose)

User Interface Layer (Client Tier)

Middle Layer (Service Tier)

Resource Layer (Front End Tier)

User Applications

Application Servers

Device Server (Field bus)

Graphical Interfaces Tools

Device Server (Timing System)

FeedbackServers

Device Server (VME, µTCA)

Device Server (PLC)

Data Acquisition

Application Servers

Feedback Servers

Shared Memory

Application Interface

Page 6: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 6

Essentials - Server

>  Server core API implemented as C++ library >  Client-Server model-based >  Multi-threaded – update thread per location, interrupt-driven threads, … >  Communication

§  Network communication based on Remote Procedure Calls (RPC) with XDR data representation §  Additional server interfaces (hardware or protocols) as separate libraries §  Timing system information via device driver interface or ZeroMQ callback

>  Configuration §  Local server configuration file defines server devices (and locations) §  Configuration mechanism with save and restore functionality i.e. keeps device settings §  Locations and properties can be added and removed on-the-fly

>  Archiving §  Extended archiving functionality local to the server (a.k.a. histories or .HIST properties) §  Long-term archiving thru flexible filter algorithm §  Recorder server with long-time archives (lifecycle of accelerator facility)

>  Server access authorization and privileges §  Implemented via UNIX user id and group id on a per-server basis §  Fine-grained XML configuration on property level

>  Logging capabilities for debugging and access (location and property) >  Conversion of raw data to physical implemented as properties -> polynomial parameters (POLYPARA) >  Algorithms for calculating mean or RMS values -> CALC property

Page 7: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 7

Device Server

Essentials – Server I/O Support

Network

Fieldbus, Hardware, …

Page 8: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 8

Essentials – Server Communication Network Protocols

Device Server

Network

Fieldbus, Hardware, …

TINE

(RPC) (Push protocol only for server notification)

Page 9: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 9

Network

Essentials – MicroTCA Server Example

Timing Server

ADC DMA Server

Toroid Server

Location 1 Location 2 Location 1

Toroid 1 Toroid 2

ADC SIS8300

ADC SIS8300

s2

Driver

Timer

Driver

DAQ

s4 s5

MicroTCA Backplane - Triggers and Clocks

Physical Device Server

I/O Device Server

Device Node

Device Driver

AMC

© K. Rehlich

Page 10: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 10

Tools

>  Tools §  C++ Client API §  Java Client API §  Python Bindings to C++ Client API §  MATLAB Bindings to C++ Client API §  JDDD §  RPC Utility §  Watchdog §  MicroTCA §  Network

Page 11: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 11

Tools – Command Line Utilities

>  Command Line Interface Tools (CLI Tools) §  Using DOOCS C++ client API

§  doocsget and doocsput – lots of options for retrieving and formatting

§  dhisttool for examining, maintaining and repairing archives

[mcswilksen:~] wilksen% doocsget -a -c "XFEL.UTIL/TUNNEL.TEMPERATURE/XTLL3/HUMIDITY.HIST" -H # Address : XFEL.UTIL/TUNNEL.TEMPERATURE/XTLL3/HUMIDITY.HIST # Data Type : A_TS_FLOAT # TDS array length = 2000 2017-06-21 13:17:16,821 1498043836 821 0 : 3.9998779e+01 2017-06-21 13:20:58,382 1498044058 382 0 : 4.0047611e+01 2017-06-21 13:22:39,093 1498044159 93 0 : 3.9998779e+01 2017-06-21 13:22:49,164 1498044169 164 0 : 4.0047611e+01 2017-06-21 13:23:09,306 1498044189 306 0 : 3.9998779e+01 <...> [mcswilksen:~] wilksen% doocsget -c "XFEL.VAC/ABSORBER/XTD2_V10000M/STATE" OPENED

Page 12: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 12

Tools – Python 3 Command Line Tools

>  Python bindings are using the C++ DOOCS client API >  Python 3 only, specifically using the Anaconda distribution to simplify

cross-platform and (!) cross-control system support >  Only client implementation, not yet all data types are implemented

>  Basic read call in Python using the pydoocs package:

[mcswilksen:~] wilksen% /opt/anaconda3/bin/python

Python 3.4.5 |Anaconda 2.3.0 (x86_64)| (default, Jul 2 2016, 17:47:57)

[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import pydoocs

>>> toroidData = pydoocs.read("XFEL.DIAG/TOROID/TORA.25.I1/CHARGE.SA1")

>>> toroidData

{'macropulse': 1412481288, 'channel': 'XFEL.DIAG/TOROID/TORA.25.I1/CHARGE.SA1', 'timestamp': 1498242907.235073, 'type': 'FLOAT', 'data': 0.5049999952316284}

>>>

Page 13: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 13

Tools – MATLAB Command Line Interface

>  Implemented with DOOCS C++ client API as MEX functions §  doocsread §  Doocswrite

[mcswilksen:~] wilksen% matlab2016 -nodesktop -nosplash

< M A T L A B (R) >

Copyright 1984-2016 The MathWorks, Inc.

R2016b (9.1.0.441655) 64-bit (maci64)

September 7, 2016

To get started, type one of these: helpwin, helpdesk, or demo.

For product information, visit www.mathworks.com.

>> result = doocsread('XFEL.DIAG/TOROID/TORA.25.I1/CHARGE.SA1');

>> result

result =

struct with fields:

channel: 'XFEL.DIAG/TOROID/TORA.25.I1/CHARGE.SA1'

data: 0.500050008296967

timestamp: 1498461821.6088

systemstamp: 1414670455

type: 'FLOAT'

error: ’’

Page 14: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 14

Tools – Java DOOCS Data Display (JDDD)

Accelerator FLASH MainTaskbar: Starting point for all accelerator operations

Page 15: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 15

Tools – JDDD Basics

>  The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

>  Create complex control system panels without programming >  Main concept:

§  Control system experts provide tool (JDDD) and generic panels (GUIs) §  System experts provide panels for their systems §  Operators can provide or enhance panels specific to operations §  Users provide panels for beamlines and beamline experiments (applies only for FLASH currently)

>  Rich set of widgets for representing control system objects §  Dynamic layouts and components with animated graphics §  Conditional widgets, dials, audio, colored indicator, location chooser,… §  Plotting widgets with integrated (simple) data analyses (mean, RMS, …)

>  Centrally hosted panels as XML files (Subversion repository with versioning) >  Extended data manipulation with JavaScript (Mathematical operations) >  Smart address generation with DOOCS Syntax, regular expression filter and global or

local parameters >  Huge number of options for plotting – domain, history, logic plots ... >  HTML-based version of JDDD available for remote access via browser (https://

jddd.desy.de)

Page 16: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 16

Tools – JDDD Editor

Inspector Available widgets/components

Component properties

Panel Editor http://jddd.desy.de -> Help

Page 17: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 17

Tools – Browser

>  RPC (Remote Procedure Call) Java Tool to browse all DOOCS channels in DESY name space >  Use as an “explorer” tool to learn about the system >  Based on JDDD (it is actually kind of JDDD panel)

Page 18: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 18

Tools – Browser (cont’d)

Filter with regular expressions Plot all locations

Read values as text (file)

Copy selected channel address

Read and set values

FLASH MainTaskbar -> Status -> Control System -> RPC Utility

Page 19: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 19

Tools – Watchdog

>  Watchdog on every node §  Manages and monitors all server processes

§  Auto-restart of server processes

§  Error reports

§  Statistics reports

FLASH MainTaskbar -> Status -> Control System -> DOOCS Watchdog

Page 20: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 20

Tools – Watchdog Overview

>  Watchdog Overview i.e. FS-FLASH-D

Page 21: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 21

Tools – Management MicroTCA Systems

FLASH MainTaskbar -> Status -> Control System -> MicroTCA Systems

Watchdog Status Green == OK Yellow == Error

MicroTCA Crate Status

Page 22: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 22

Tools – Management MicroTCA Systems Crate Overview

MicroTCA System Crate Overview: Status of each AMC and RTM -> Reboot, restart

Page 23: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 23

Tools – FLASH Network Monitoring

FLASH MainTaskbar -> Status -> Control System -> DOOCS System Status -> Network Status

Red Switch -> Switch Down, call NOC and MCS4

Flat I/O Rate: TINE Recorder Down -> Notify MCS4

Page 24: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 24

Data Acquisition System

> Data Acquisition System § General Layout § Middle Layer Services § FLASH DAQ Instances § DAQ Tools

Page 25: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 25

Middle Layer

Data Acquisition System – General Layout

Device Layer

Fast ADC, Camera

PLC, slow ADC

Slow Collector

Distributor

Central Shared Memory

Event Builder

RAID Cluster dCache

Run

C

ontro

ller

Fast Collector

Fast ADC, Camera

Fast ADC, Camera

PLC, slow ADC

PLC, slow ADC

Middle Layer Server

User

Application

Layer

DAQ Data Access Framework Other

Applications Data GUI

MATLAB/Octave

JDDD/ JDAQ

C/C++ Interface

Fast, bunch-synchronous data Slow data (fixed rate or event-based)

File I/O

TCP

Shared Memory

Multicast

RPC

Middle Layer Server

Middle Layer Server

Page 26: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 26

Data Acquisition System – Middle Layer Server

ADC Camera

Collector

Buffer Manager (Shared Memory)

Event Builder

Distributor

R RAW Streams

RAID Middle Layer Servers or Application Servers

•  Middle layer server is a client with respect to the

buffer manager. Hence it has access to all subscribed event types and shot-synchronized data..

•  Can not only read data (consumer), but also process it and write results back to the same event record (producer).

•  Notified when requested data (subscribed channels) are available in shared memory.

•  Can perform many kinds of computational tasks. •  Uses MATLAB or C/C++ for calculations, standard

mathematical libraries are vastly available. •  Sufficient response time for many operational and

automation purposes. Examples: Energy measurement, photon wavelength measurement, gas monitor detector server, LLRF server, orbit server

•  Two API options for ML server development.

Middle Layer Server

Page 27: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 27

Data Acquisition System – FLASH DAQ Instances

Seven DAQ instances at FLASH: FLASH MAIN DAQ, User DAQs, TEST DAQ (SFLASH)

Instance: MAIN DAQ

Disk Space: green or yellow = OK

Input Rates: OK if > 0, If dip occurs -> FED problem

Output Rates: OK if > 0

FLASH MainTaskbar -> Status -> Control System -> DAQ Status

Traffic Lights == Health Status: Grey = Off/Idle Green = OK Yellow = Still OK Red = Take Action, check Status Panel

Page 28: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 28

Data Acquisition System – FLASH MAIN DAQ Status Panel

DAQ Middle Layer

Servers

Buffer Manager

Collector

Front-End Server

Event Builder and Writer

Loss Rates

Disk Status

Restart Button

FLASH MainTaskbar -> Status -> Control System -> DAQ Status -> MAIN -> Status

Event Number should increment

Lost Event Number should NOT increment

FED Sender Status: Green == OK Orange/Yellow == ERROR Light Grey == OFF Dark Grey == System/Process Down

Page 29: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 29

Data Acquisition System – DAQ Tools (Selection)

>  Data Retrieval (Non-Middle Layer Services) §  Several API to read and extract data: C++- and Java-based ones. On top of these:

MATLAB (Octave, Mathematica), JDDD, DAQ Data GUI, Python-based one soon

§  DAQdataGUI

§  JDDD

§  MATLAB

Java-based DAQ GUI

DAQ Data GUI Channel data by shot

Page 30: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 30

Failure Detection – “Red JDDD Object”

“Red” JDDD Object? (!= Watchdog otherwise go to

“System Down”)

Shows “Unavailable

Server”?

No

Yes

Shows “Java Script Error”?

Check Watchdog Panel

Restart JDDD Session Server Down?

Yes

No

Try To Restart Server via Watchdog Panel

Server Running Again?

OK

No

No

Yes Yes

Shows “Illegal

Location”?

Yes

What? Shows “Link Time Out”?

Notify or Call System Experts (or last resort,

MCS4)

Check FEC Status

No

Yes

No Server Down?

Yes

Yes

Page 31: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 31

Failure Detection – “System Down”

System Down? (== Watchdog Red)

Is it a MicroTCA System?

Yes

Is the Crate Status Panel Accessible?

No

Try To Restart Watchdog via command line

OK

No

No

Yes Yes Is it possible to log on with

ssh?

Yes

No

No

Yes

Notify or Call System Experts (or last resort,

MCS4)

Power-cycle CPU AMC Via Crate Status Panel

System And Watchdog Running Again?

Power-cycle MicroTCA System Via MCH CLI

System And Watchdog Running Again?

Page 32: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 32

Failure Detection – “DAQ Traffic Light Red”

Traffic Light For DAQ Instance “Red”?

Disk Status on Instance Overview

Red?

No

Yes

Check DAQ Status Panel

Restart ML Server After Cycling It To INIT State Via

Watchdog Panel

DAQ Server Not Running?

(!= ML Server)

Yes

No

Restart DAQ Instance Via DAQ Status Panel

Traffic Light Green Again?

OK

No

Yes

Notify or Call System Experts (or last resort,

MCS4)

Yes

DAQ Server Not Running?

(== ML Server)

Yes

No

Page 33: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 33

Failure Detection – “DAQ Traffic Light Red” JDDD Version

Flow chart for failure detection and resolution implemented as JDDD panel with active buttons

Page 34: FLASH Control System Operator Training · > The Java DOOCS Data Display (JDDD) is an editor for graphical user interfaces to the accelerator control system (often called “panels”)

Tim Wilksen | FLASH Controls System Overview | 14.07.2017 | Page 34

References

Web reference: >  DOOCS Web Page: http://doocs.desy.de

>  FAQ: DOOCS Web Page -> FAQ or https://ttfinfo.desy.de/FLASHWiki/Wiki.jsp?page=FAQ

Request Tracker (Email) also via Logbook: >  [email protected]