beam synchronous acquisition on ioc

19
Stephanie Allison LCLS Meeting [email protected] Sep 22, 2008 Beam Synchronous Acquisition on IOC Definition/Requirements Current Implementation (based on SLC BPM Acq) Code - MikeZ, Debbie, Mods/Test - saa Alternative to BSA To add BSA to an IOC, see: http://www.slac.stanford.edu/grp/lcls/ controls/global/subsystems/timing/ lclsBsa.ppt

Upload: zuzana

Post on 21-Mar-2016

68 views

Category:

Documents


1 download

DESCRIPTION

Beam Synchronous Acquisition on IOC. Definition/Requirements Current Implementation (based on SLC BPM Acq) Code - MikeZ, Debbie, Mods/Test - saa Alternative to BSA To add BSA to an IOC, see: http://www.slac.stanford.edu/grp/lcls/controls/global/subsystems/timing/lclsBsa.ppt. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Beam Synchronous Acquisition on IOC

Stephanie Allison LCLS Meeting [email protected] 22, 2008

Beam Synchronous Acquisition on IOC

Definition/RequirementsCurrent Implementation (based on SLC BPM Acq)

Code - MikeZ, Debbie, Mods/Test - saa

Alternative to BSATo add BSA to an IOC, see:

http://www.slac.stanford.edu/grp/lcls/controls/global/subsystems/timing/lclsBsa.ppt

Page 2: Beam Synchronous Acquisition on IOC

Stephanie Allison LCLS Meeting [email protected] 22, 2008

Definition/RequirementsAcquire all beam-dependent scalars across multiple IOCs on the same pulse over multiple pulses of a certain kind (not just x-pulses-in-a-row) up to 120Hz.Acquire up to 2800 values per scalar in one acquisition request.Each value of the 2800 values can be an average of up to 1000 values.Each acquisition request can specify:

Beam code (defines project, 1 = LCLS) Machine conditions of interest – rate, TS, permits, etc Maximum severity which data is considered good

Provide constant 1HZ beam-synchronous data for channel archiver and displays (reduce network load without losing synchronicity).

Page 3: Beam Synchronous Acquisition on IOC

Stephanie Allison LCLS Meeting [email protected] 22, 2008

Current ImplementationThree Parts to BSA:

User request for an acquisition (aka event definition or EDEF) done by CA client.Data gathering done on the EVG and EVR IOCsWhen gathering is finished, access of prepared data waiting on IOCs done by CA clients, with checks for a good acquisition. Only the data gathering part is discussed in this talk.

Page 4: Beam Synchronous Acquisition on IOC

Stephanie Allison LCLS Meeting [email protected] 22, 2008

IOC Data Gathering

Data gathering part consists of the following actions:EDEF setup and start request done on the EVG IOC.360hz checking on the EVG IOC with user notification when finished.360hz requests (acquisition control) sent by the EVG IOC to all EVR IOCs via fast fiber optic link.Data checking, averaging, and array update per scalar record per request on the EVR IOCs.

Data on EVR IOC must be available within 7.3 msec after beam or it will be lost, even when beam is less than 120hz. EDEF will finish with arrays that are not complete if this time budget cannot be met.For an acquisition at full beam rate (ie, 30hz), if data is acquired at a lower rate (ie, 10hz), the array will not be complete. Use rate-limit bits as-needed when setting up the EDEF.Implementation is all EPICS record-based.

EVR

IOC

EVG

PNET

IOC

BPM FEETriggers

Timing Crate

BPM Crate

Data

CA Client

EDEF Flags, Pattern, etc

EDEF Setup CA Client

BSA Data

Page 5: Beam Synchronous Acquisition on IOC

Data Acquisition Across IOCs

EVR IOC1EDEF #1

EVR IOC2EDEF #1

EDEF #15

EDEF #15

… …

All arrays have 2800 values, # values used depends on user request

EDEF #1

EDEF #15

EVG IOC

EVR IOC scalar data – X, Y, TMIT, Phase, Amplitude, PMT, Position, Bunch Length

Pattern 1

nth element

of all arrays is on the same pulse.

Scalar 1

EDEF #1

EDEF #15

Scalar n

Scalar 1

EVG IOC Scalar data – 32 bit patterns (6), pulse ID, timestamp secs, timestamp nsec

Page 6: Beam Synchronous Acquisition on IOC

IOC

TH

2

EVR

BPM module

Timing patternfrom EVG 1

OPIMatlab

X=lcaGet(‘BPMS:IN20:221:XHSTTH’);

Controlsnetwork

FromBPM

EDEFe.g. 10 Hz

BSAStorage

For 20 EDEFs

BPMS:IN20:221:XHSTTHBPMS:IN20:221:YHSTTHBPMS:IN20:221:TMITHSTTH

Conceptual data flow for Beam Synchronous Acquisition – 10Hz System EDEF

Data at full rate

Slide from Patrick Krejcik, modified by saa

F2

F1

BR

Page 7: Beam Synchronous Acquisition on IOC

EVR Event Time Line – 4 Fiducials/120Hz Beam

F2 F1 F00 2.8 5.6

360Hz Fiducial

Time (msec)

B0

9.3F3

8.3

B3120Hz BEAM

1.0

BPM Records Ready

BPM BSA

Records Done

All B3 BSA

MUST be finished

before F0

Slower GADCs Ready

Slower GADC BSA Done

Page 8: Beam Synchronous Acquisition on IOC

Implementation – EVG IOC – Global Event Display

Page 9: Beam Synchronous Acquisition on IOC

Implementation – EVG IOC – All EDEF Diag DisplayPut new app name in

reserve record – edefReserve sequence

will assign next available EDEF number

“alan” app is using EDEF 12 until freed by the app – “alan”

can do multiple acqs

System EDEFs are reserved and setup

at EVG IOC boot and never freed.

15 user-defined requests at one time,

is this enough? Issue – apps that

crash before freeing.

Page 10: Beam Synchronous Acquisition on IOC

Implementation – EVG IOC – EDEF Diag Display

Beam code describes project, 1 = LCLS (0=any beam code – good for testing)

Turn “ON” when ready. EVG IOC 360Hz event task will turn “OFF” when finished. Turn

back “ON” to flush and restart the acq.

Define # in each average, # measurements, severity at or above which data is not included in average. Forever

option used by system EDEFs.

Set machine conditions – values acquired only on

pulses where ALL inclusion conditions are true AND NO exclusion condition is true

Push “FREE” to free this EDEF number. Name and user will be blanked out.

Page 11: Beam Synchronous Acquisition on IOC

Implementation – EVG IOC – EDEF Mask Diag Display

Choose conditions that define the pulses of interest. Only pulses with these conditions will provide values to the acquisition. The edefMask sequence on the EVG IOC creates the masks used by the 360Hz event task.

Condition (bit) names come from the SLC Database

(PNBN) and ordered alphabetically in new records by the edefMask sequence.

Page 12: Beam Synchronous Acquisition on IOC

Stephanie Allison LCLS Meeting [email protected] 22, 2008

Alternative to BSA – Client does all the work!Clients monitor all data (data, status, pattern, etc) from all IOCs using channel access. Timestamps are checked to determine data on the same pulse. Extra logic and retries needed for missing data when at higher rates (IOC CA server runs at low priority and may skip some updates). Also, network glitches and high traffic an issue.Client does same pattern checking, timestamp validation, averaging, RMS, etc, now done on IOCs.

Page 13: Beam Synchronous Acquisition on IOC

Stephanie Allison LCLS Meeting [email protected] 22, 2008

Background on Implementation

Page 14: Beam Synchronous Acquisition on IOC

Stephanie Allison LCLS Meeting [email protected] 22, 2008

Implementation – EVG IOC 360Hz TaskThe 360hz event task wakes up on interrupt from the PNET module. One of its many duties is to check for a match between the new pulse’s pattern and beam code and each active EDEFs. It keeps a count of the number of measurements and the number of values in the current average per EDEF. Masks are prepared:

Pattern matchAverage doneNew request (clear history) Bad data severity

A detail - pulse information is pipelined - the new pulse is actually for 3 pulses ahead.For the current pulse, for each EDEF that matches, if the average is done, the pattern (5 “modifier” 32bit integers) and pulse ID are stored in arrays for that EDEF that match the arrays provided by the EVR IOCs for scalar data.

Page 15: Beam Synchronous Acquisition on IOC

Stephanie Allison LCLS Meeting [email protected] 22, 2008

Implementation – EVG-to-EVR 360Hz Data Transfer

8-bit Event C

ode

8-bit MP

S D

ata(S

hared Data B

us)

8-bit Event B

uffer

8-bit Event C

ode

8-bit Event C

ode

8-bit MP

S D

ata(S

hared Data B

us)

8-bit Event B

uffer

8-bit Event C

ode

. . .. . .

EVG EVR

8-bit Event C

ode

8-bit MP

S D

ata(S

hared Data B

us)

8-bit Event B

uffer

8-bit Event C

ode

8-bit Event C

ode

8-bit Event C

odeTime (nsec)

8.4 16.8 25.2 33.6 42.0 50.4 58.8 65.28-bit E

vent Buffer

8-bit MP

S D

ata(S

hared Data B

us)

EDEF bit masks included in 360Hz data sent by EVG to EVR. EVR IOC caches the data on data interrupt. The EVR IOC 360Hz event task is activated on the next fiducial interrupt (event code 1) and it

copies the data to records at the end of the pipeline and then moves up the pipeline. Records with current conditions are then available to BSA record processing done later in the same pulse. The task also triggers sequences via event to clear history and averaging when a new measurement is started.

Page 16: Beam Synchronous Acquisition on IOC

<ioc>:MODIFIER5.A

EVR IOC BSA Record Processing (TORO example)SCAN=IO Intr

TMITEF FanoutRecords

TORO TMIT ai Record

LCLS Time

Stamps

FLNK

FLNK

LNK1FLNK

TMIT1GO bo Record

TMIT1 sSub Record:

Averages good values, finds RMS,

counts # good values in the average,

checks timestamps

TMIT1HSTcompress Record

LNK2 TMIT2GO bo Record

TMITF2GO bo Record“LNK20”

.

.

.

SDIS

<ioc>:MODIFIER5.TSDIS

<ioc>:MODIFIER5.BSDIS

FLNK

FLNK

VAL, SEVR, timestamp

timestamp

<ioc>:EDEFAVGDONE.A, <ioc>:EDEFMEASSEVR.A

FLNK

VAL

X (SDIS)

FLNK

TMITCNT1HSTcompress Record

TMITRMS1HSTcompress Record

M

X (SDIS)

L

X (SDIS)

Arrays used by BSA CA client:

sSub and compress records reset via

TMITINIT1 sequence record on acq startup.

Page 17: Beam Synchronous Acquisition on IOC

EVR IOC BSA Record Processing – Event Device Display

Page 18: Beam Synchronous Acquisition on IOC

EVR IOC BSA Record Proc – Event Device Diag Display

Page 19: Beam Synchronous Acquisition on IOC

EVR IOC BSA Record Processing – BSA Diag Display

Copied from EDEF diag

display

RMS zero when # avg is 1

Last averaged values

Various inputs/outputs to averaging sSub record

Last 100 values of value