Private
Public Access
11
1
6
Realtime Sampler Configuration
watts edited this page 2024-06-12 16:31:41 +02:00

Introduction

The Pixelator/Orocos system includes a feature that allows a data channel (that can be slow to respond) to be sampled at a fast rate and thus allow the data channel to be recorded on a pixel-by-pixel basis. This is used at PolLux to record variations in the storage ring current. This has been implemented for both the obsolete "Orchestra" realtime system (i.e. "Orchestra Detector") and the currently recommended "Orocos" realtime system. At the time of writing, this is only implemented for EPICS and TANGO channels, but it is easy to implement for other positioner types by copying code that references "rtDetector" in PixelatorController/src/EpicsPositioner.cc into the code for other positioner types.

Configuring a realtime sampler requires:

  • An Orocos type controller (just one for all realtime sampler channels)
  • An OrocosSampler type detector (just one for all realtime sampler channels)
  • The RealtimeSampler Orocos module correctly configured in start.ops
  • The positioner configuration includes the fields:
    • "rtDetector" whose value is the name of the OrocosSampler type detector
    • "rtDetectorChannelIndex" whose value is an unique channel index integer

Example from the PolLux Configuration

Orocos Controller

 "Orocos1" : {
   "active" : 1,
   "type" : "Orocos",
   "nAxes" : 3
},

Note that the controller only needs to exist. The nAxes field refers to the axis configuration and is not related to the realtime sampler. See Config_Controller#orocos for full details.

OrocosSampler Detector

"OrocosDetector1" : {
   "active" : 1,
   "controller" : "Orocos1",
   "type" : "OrocosSampler",
   "autoRecord" : 1,
   "monitor" : 1,
   "nexus_name" : "orocos1"
},

Note that only one OrocosSampler Detector needs to exist. See Config_Detector for full details.

Positioner

Note that any positioner can be added to the realtime sampler by adding the appropriate fields, so long as it is implemented for its type (i.e. EPICS). All detectors are written into the /entry/instrument/ section of the data file and setting rtDetectorMonitor to true will cause a corresponding NXmonitor group to also be written to the /entry/ section. The NeXus standard says that the default normalisation data should be written into an NXmonitor group called "control".

"Ring_Current" : {
   "active" : 1,
   "description" : "Storage ring electron beam current",
   "getChannel" : "ARIDI-PCT:CURRENT",
   "nexus_name" : "control",
   "readOnly" : true,
   "rtDetector" : "OrocosDetector1",
   "rtDetectorChannelIndex" : 0,
   "rtDetectorMonitor" : true,
   "type" : "Epics",
   "unitChannel" : "ARIDI-PCT:CURRENT.EGU"
},
"user_data_13" : {
   "active" : 0,
   "description" : "User Input 13",
   "getChannel" : "X07DA-ES1-USER13:DAT",
   "readOnly" : true,
   "rtDetector" : "OrocosDetector1",
   "rtDetectorChannelIndex" : 13,
   "rtDetectorMonitor" : false,
   "type" : "Epics",
   "unitChannel" : "X07DA-ES1-USER13:DAT.EGU"
},

start.ops

The following commands (or something similar) are needed to properly set up the RealtimeSampler in Orocos.

import("RealtimeSampler")
loadComponent("RtSampler","RealtimeSampler")
setActivity("RtSampler", 0.0, 1 , ORO_SCHED_RT )
connect("DI1.inputState","RtSampler.pixelClkSig", cp )
connect("DI1.inputCounter","RtSampler.pixelClkNr", cp )
connectPeers ("RtSampler","ComCon")
RtSampler.configure
RtSampler.start

Note that DI1 is a digital input module that also needs to be correctly set up.