Skip to main content
U.S. flag

An official website of the United States government

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

CHRNS: Absolute timing infrastructure

Overview

The project relied on being able to attach absolute timestamps to neutron detection, motors, and ancillary equipment events. The instrument control program, NICE, interfaces with sample environments in a robust fashion (fault-tolerant; plug-n-play), these sample environments can be controlled by NICE and participate in the timing infrastructure. This means that only one driver is programmed into NICE to operate across all compatible sample environments (see CHRNS: Stopped flow capabilities for an example). The SECoPs-like environment is flexible (C++, Python, and LabVIEW libraries on Windows, Linux, and OSX), and expands the programming capabilities outside of the NICE team and allows users to program their own equipment, and provides a reduced barrier to enabling experiments (CHRNS staff can help as necessary!)

To achieve the highest timing resolution needed for certain experiments (e.g., relaxation microwave excitations on magnetic monopoles on MACS), the timing requirements are in the microsecond regime and unsuitable for most operating systems. Given these stringent requirements, we adopted the real-time capabilities of the National Instruments CompactRIO (cRIO) as the primary sample-environment controller.

Neutron capture events (and all other events) are timestamped using the Precision Time Protocol (PTP) using a master GPS clock at the NCNR (time.ncnr.nist.gov). MACS, CANDOR, and VSANS all required modifications to the detection hardware to enable these capabilities. While it is relatively straightforward on MACS (and we had prior experience implementing this on DCS and prototyping for this experiment), the other two instruments required bespoke solutions with the requisite prototyping, testing, troubleshooting, and final design and manufacturing of components. The final product is a flexible Multipurpose Absolute Time Synchronizer Scaler Equipment (MATISSE) deployed on the instruments. 

An experiment further requires Instrument configurations (defined essentially by motor and servo positions) and other meta-data from NICE (user information, experiment title, measurement intent, start/stop counts etc.). Motor positions are available from the updated VIPER program across the facility. 

All events from their respective sources are captured as information packets and transmitted to our Redpanda messaging system (based on Apache Kafka). This scalable system, installed on the newest computer hardware, allows us to define a series of self-describing data streams based on common schemas. We have developed real-time data and parameter visualization, and data treatment for users.

Required timing resolution

Any neutron and sample environment timed series of events has to be brought in to coincidence using data reduction/analysis. The delay between the neutron interacting with the sample and its detection needs to be known. Similarly, the uncertainty in the neutron time-of-flight sets an upper bound on the maximum achievable time resolution. For velocity selector instruments, the resolution is low due to a large δλ/λ, while for crystal monochromator/analyzer instruments, this depends on the crystal and mosaic properties. A full McStas simulation of MACS was performed to characterize these parameters (and it also allows the full dynamics instrument resolution to be calculated). A summary of results is given in the following table.

MACS McStass
McStas simulation of MACS

 

InstrumentConfigurationt (delay)  (ms)≈Resolution, δt (ms)
MACSAny1-to-2>0.01
CANDORClosest dets.4.60.03
 Furthest det.5.40.01

VSANS

(Center of detector)

Converging beam,

6.7 Å, dl/l=12.5%

Rear: 35.6

Mid: 29.6

Front: 5.9

Rear: 10.2

Mid: 8.5

Front: 2.7

 

Converging beam, 

medium Q

9 Å, dl/l=12.5%

Mid: 39.8

Front: 8.0

Mid: 12.2

Front: 2.2

 

Converging beam, 

large Q

9 Å, dl/l=12.5%

Mid: 8.0

Front: 2.0

Mid: 2.2

Front: 0.6

 

High res,

large Q

4.75 Å, dl/l=1%

Mid: 4.8

Front: 1.2

Mid: 0.1

Front: 0.02

Achievements

  • Operational MACS time-stamper from Reuter-Stokers (Jan. 2023)
  • Operational absolute time stamping MATISSE hardware for  VSANS/CANDOR (June 2023)
  • Plug-n-play on cRIO and existing drivers in NICE (operational)
  • VIPER has been rewritten for absolute time-stamps of motor readings
  • Streaming data system using Redpanda

SECOPS

  • SECoPS successfully deployed on the home-built stopped flow system (Python on any OS)
  • SECoPS for temperature controllers (Windows and Linux; and for cRIO)
  • Most sample environments can now work with SECOPS
  • NICE incorporation of SECoPS

Data histogramming/rebinning

  • Constructed data writers for streamed data
  • Use prior NICE records to stream events to Redpanda and rewrite the equivalent data file
  • Incorporate streaming of information to key parts of NICE
  • Web interface and API 

 

CHRNS event-mode rebinding
Web interface to rebin event-mode data

 

 

 

 

 

Contacts

Created February 4, 2023, Updated August 23, 2026
Was this page helpful?