Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Operator: controls the accelerator, driving the beam with the parameters requested by the user (the users are not represented on this diagram). The Operator is responsible for identifying issues and solve them or call IOC maintainers or Physicists in order to get the best quality of a beam.
  • Physicist: understands and design the connection between the electron and photon beam parameters, how sub-systems are interconnected and how the changing in parameters affects the overall beam quality.
  • IOC maintainer: engineer responsible for diagnosing problems in IOCs, fixing bugs, and improving the software. For ATCA based platform, the IOC maintainer actor can also mean a firmware maintainer, that deals with the FPGA on carrier boards.
  • BPM IOC: this represents an IOC responsible for measuring the electron beam position on a cross-section of the accelerator.
  • Fast feedback: this system receives parameters from key accelerator systems and acts to correct the electron beam.
  • MPS: this is the system responsible for the safety of some of the equipment of the accelerator.
  • BSA: system responsible to hold important data aligned with a specific beam pulse in a way that a user can compare the state of many parameters of the accelerator within the same pulse.

Anchor
CALC_MAX_CURR
CALC_MAX_CURR
Calculate the maximum current and signal sum

The goal is to receive inputs from sensors and other systems and calculate the maximum current and charge (called signal sum) of the electron beam. Those are indirect measurements representing the amplitude and area of a Gaussian, which are easily translated to a bunch length by the Physicists. Details on this process and the calculation itself are described in How the Length of the Bunch is Measured

...

The weight parameters A0 and A1, and Offset are the first 3 boxes on the snapshot.

The last section of this document showed how the integration windows are adjusted. An EPICS database takes care of changing A0 and A1 automatically when the windows' width is changed. So, this guarantees that if the background and signal are approximately horizontal lines, no change in the window's width will change the final result of ARAW. A deep detail about this database is described in Auto adjustment of weight factors A0 and A1 below.

...

table below connects registers, Asyn parameters, and PVs. Offset is called as the Coefficient I by the firmware.

Register nameAsyn parameter namePV

/mmio/AppTop/AppCore/SysGenMr[0]/DspCoreConfigMr/CoefA0

AMC0:CoefA0BLEN:$(AREA):$(POS):$(INST)_CoefA0
/mmio/AppTop/AppCore/SysGenMr[1]/DspCoreConfigMr/CoefA0

AMC1:CoefA0

BLEN:$(AREA):$(POS):$(INST)_CoefA0
/mmio/AppTop/AppCore/SysGenMr[0]/DspCoreConfigMr/CoefA1AMC0:CoefA1BLEN:$(AREA):$(POS):$(INST)_CoefA1
/mmio/AppTop/AppCore/SysGenMr[1]/DspCoreConfigMr/CoefA1AMC1:CoefA1BLEN:$(AREA):$(POS):$(INST)_CoefA1
/mmio/AppTop/AppCore/SysGenMr[0]/DspCoreConfigMr/CoefIAMC0:CoefIBLEN:$(AREA):$(POS):$(INST)_CoefI
/mmio/AppTop/AppCore/SysGenMr[1]/DspCoreConfigMr/CoefIAMC1:CoefIBLEN:$(AREA):$(POS):$(INST)_CoefI

The last section of this document showed how the integration windows are adjusted. An EPICS database takes care of changing A0 and A1 automatically when the windows' width is changed. So, this guarantees that if the background and signal are approximately horizontal lines, no change in the window's width will change the final result of ARAW. A deep detail about this database is described in Auto adjustment of weight factors A0 and A1 below.

Coefficients of the equation

Revisiting the equation defined some sections above, we already have described the origin of two components:

The remaining coefficients are given directly by the Physicist and are PVs that write to and read directly from the FPGA registers. The screen that exposes these PVs is the same one shown in the previous section. This is the table connecting registers, Asyn parameters, and PVs:

Register nameAsyn parameter namePV

/mmio/AppTop/AppCore/SysGenMr[0]/DspCoreConfigMr/CoefB

AMC0:CoefBBLEN:$(AREA):$(POS):$(INST)_CoefB
/mmio/AppTop/AppCore/SysGenMr[1]/DspCoreConfigMr/CoefB

AMC1:CoefB

BLEN:$(AREA):$(POS):$(INST)_CoefB
/mmio/AppTop/AppCore/SysGenMr[0]/DspCoreConfigMr/CoefCAMC0:CoefCBLEN:$(AREA):$(POS):$(INST)_CoefC
/mmio/AppTop/AppCore/SysGenMr[1]/DspCoreConfigMr/CoefCAMC1:CoefCBLEN:$(AREA):$(POS):$(INST)_CoefC
/mmio/AppTop/AppCore/SysGenMr[0]/DspCoreConfigMr/CoefDAMC0:CoefDBLEN:$(AREA):$(POS):$(INST)_CoefD
/mmio/AppTop/AppCore/SysGenMr[1]/DspCoreConfigMr/CoefDAMC1:CoefDBLEN:$(AREA):$(POS):$(INST)_CoefD
/mmio/AppTop/AppCore/SysGenMr[0]/DspCoreConfigMr/CoefE AMC0:CoefEBLEN:$(AREA):$(POS):$(INST)_CoefE
/mmio/AppTop/AppCore/SysGenMr[1]/DspCoreConfigMr/CoefEAMC1:CoefEBLEN:$(AREA):$(POS):$(INST)_CoefE
/mmio/AppTop/AppCore/SysGenMr[0]/DspCoreConfigMr/CoefFAMC0:CoefFBLEN:$(AREA):$(POS):$(INST)_CoefF
/mmio/AppTop/AppCore/SysGenMr[1]/DspCoreConfigMr/CoefFAMC1:CoefFBLEN:$(AREA):$(POS):$(INST)_CoefF
/mmio/AppTop/AppCore/SysGenMr[0]/DspCoreConfigMr/CoefGAMC0:CoefGBLEN:$(AREA):$(POS):$(INST)_CoefG
/mmio/AppTop/AppCore/SysGenMr[1]/DspCoreConfigMr/CoefGAMC1:CoefGBLEN:$(AREA):$(POS):$(INST)_CoefG
/mmio/AppTop/AppCore/SysGenMr[0]/DspCoreConfigMr/CoefHAMC0:CoefHBLEN:$(AREA):$(POS):$(INST)_CoefH
/mmio/AppTop/AppCore/SysGenMr[1]/DspCoreConfigMr/CoefHAMC1:CoefHBLEN:$(AREA):$(POS):$(INST)_CoefH 

Access a list with bunch length parameters aligned with the same timestamp

The Bunch Length IOC application provides 4 parameters for the BSA (Beam Synchronous Acquisition) system. A brief introduction for BSA can be found here: Beam Synchronous Acquisition (BSA).

These are the parameters based on the two pyrodetector sensors:

  • AIMAX: the result of the equation for sensor A, the peak current measured at the sensor and normalized, that can be transformed into the bunch length.
  • BIMAX: the result of the equation for sensor B, the peak current measured at the sensor and normalized, that can be transformed into the bunch length.
  • ARAW: the integral of the signal of the sensor A, subtracted by the integral of the background noise.
  • BRAW: the integral of the signal of the sensor B, subtracted by the integral of the background noise.

The first thing that the IOC needs to do is to create one BSA channel for each parameter. What triggers this action is the IOC shell function blenConfigure, on st.cmd. The first parameter of this function is the "Station Name" that is the beginning of the PV names of the IOC. For instance, in sector 21, st.cmd has:

Code Block
languagebash
titlest.cmd
# Area, position, and instrument names to be used in record names
epicsEnvSet("AREA", "LI24")
epicsEnvSet("POS", "886")
epicsEnvSet("INST", "BL21")


(...)
 
# blenConfigure parameters:
# 1 - Station name
# 2 - BSA stream name must be identical to definition in yaml file
# 3 - PV used to get TMIT from FCOM
# 4 - IP address and port to send TMIT information to ATCA
blenConfigure "BLEN:${AREA}:${POS}" "${BSA_STREAM_YAML_NAME}" "${TMIT_PV}" "${FPGA_IP}:${IP_PORT_TMIT}"

blenConfigure will, among other things, call the function BSA_CreateChannel, from BsaApi.h. Here are the relevant parts from blenBSA.h and blenBSA.cpp:

Code Block
languagecpp
titleblenBSA.h
#define NUM_CHANNELS 4
static const char* const channelNames[NUM_CHANNELS] = {"AIMAX", "BIMAX", "ARAW", "BRAW"};
 
class BlenBSA {
private:
    BsaChannel *bsaChannels;
(...)
public:
(...)
    int createChannels(const char *stationName);
(...)
}


Code Block
languagecpp
titleblenBSA.cpp
int BlenBSA::createChannels(const char *stationName) {
    char param_name[64];
    bsaChannels = new BsaChannel[NUM_CHANNELS];

    /* Create NUM_CHANNELS BSA channels with the name formed by the 
     * stationName that comes from the IOC shell, plus the channel
     * acronym defined by the constant array channelNames. */
    using namespace std;
    for (int i = 0; i < NUM_CHANNELS; i++) {
        sprintf(param_name, "%s:%s", stationName, channelNames[i]);
        bsaChannels[i] = BSA_CreateChannel(param_name);
    }
    return 0;
}

As explained in Calculate the maximum current and signal sum, there is a thread responsible to store the data to the BSA Core as soon as the data is ready. 

Algorithm description

Anchor
Waveform
Waveform
Waveform and integration windows

...