The waveform-builder application and scripts were design to construct waveforms from LSA that can be played in the 867 measurement lab. The waveform is a .txt file with two columns, time (s) and current (A). The current must start with 0.
GUI
Script
The mm_waveform_builder.scripts.build_lsa_from_config allows defining a generation configuration wiki:yaml which is used for waveform generation.
The call signature for the script is
python -m mm_waveform_builder.scripts.build_lsa_from_config [-h] [-p] [-o OUTPUT] [--no-confirm] [--rms-max RMS_MAX] file [file ...]
positional arguments:
file Configurations to build waveform from. Multiple configurations can be merged into one.
options:
-h, --help show this help message and exit
-p, --plot Plot waveform after generation
-o OUTPUT, --output OUTPUT
Output directory.
--no-confirm Do not prompt before generating waveform.
--rms-max RMS_MAX Maximum RMS current in A.The script takes a configuration YAML as input and outputs a directory to the --output argument value directory with 2 files:
waveform.txt: The generated waveform, with 2 columnsslices.yml: The slices of each cycle in the generated waveform. This allows simpler post-processing of measurements, if cycle-by-cycle analysis is required.
Prior to writing the generated waveform, if -p is used, the waveform will be plotted with matplotlib.
The --rms-max argument allows setting the value. By default this is 3000 for the 867 HOLEC, and the script uses the default decay time of 61.5s.N.B. The calculation is accurate, but the system response of the HOLEC seems to be nonlinear, and therefore this functionality is not entirely useful.
Script Configuration
The configuration YAML takes the following form:
parameter: MBI/IREF
pad_zero: 10.0
supercycles:
PHYS_LHCFILL_ZERO:
cycles:
- SHiP_L1230_2024_V2
- SPS_TIMING_2021_V1
- LHC_PILOT_Q20_2024_V1
- SPS_TIMING_2021_V1
- SPS_TIMING_2021_V1
- SPS_TIMING_2021_V1
# - MD_26_L60_Q20_2022_V1
PHYS_ZERO:
cycles:
- SHiP_L1230_2024_V2
- SPS_TIMING_2021_V1
- SPS_TIMING_2021_V1
- SPS_TIMING_2021_V1
- SHiP_L1230_2024_V2
- SPS_TIMING_2021_V1
- SPS_TIMING_2021_V1
- SPS_TIMING_2021_V1
cycles:
- supercycle: PHYS_ZERO
- supercycle: PHYS_ZERO
- supercycle: PHYS_ZERO
- supercycle: PHYS_ZERO
- supercycle: PHYS_ZERO
- supercycle: PHYS_LHCFILL_ZERO
- supercycle: PHYS_LHCFILL_ZERO
- supercycle: PHYS_LHCFILL_ZERO
- supercycle: PHYS_LHCFILL_ZERO
- supercycle: PHYS_LHCFILL_ZERO
- supercycle: PHYS_ZERO
- supercycle: PHYS_ZERO
- supercycle: PHYS_ZERO
- supercycle: PHYS_ZERO
- supercycle: PHYS_ZERO- The
parametervalue controls which LSA parameter to retrieve the discrete function from. - The
pad_zerocontrols how many seconds of 0 will be pre- and appended to the waveform. A linear ramp will connect the 0-values to the initial reference current to avoid a step. This key is optional. - The
supercycleskey allows the definition of Supercycles, which compose multiple subcycles with thecyclessubkey. The defined supercycle can be used in the top-levelcycleskey. - The
cyclessection is the most important section of the configuration. Here you can put the supercycles to “play”, or cycles.- Supercycles are specified with
supercyclekey. - Cycles can be used with
cyclekey to directly specify an individual cycle. - Timing users can be used with the
userkey. (e.g.SFTPRO1) - In addition, the
idlekey allows to specify a “wait” time to remain at idle current, specified in milliseconds, to put an artificial “break” between cycles.
- Supercycles are specified with
For the cycle and user keys, subkeys scaleX and scaleY are allowed, and allow the scaling of cycles in time and current values.
Sample configurations
parameter: "QF/IREF"
pad_zero: 5.0
cycles:
- user: SFTPRO1
scaleY: 0.5
- cycle: SFT_PRO_MTE_L4780_2023_V2Combining multiple configuration files
Multiple configuration files can be merged together, by specifying multiple configurations at the command line. The input_file argument accepts multiple arguments, and configurations are merged left-to-right, with right-most taking precedence.
Economy modes
By appending _DYNECO or _FULLECO to cycle names in either the Supercycle definition or cycles definition, the constructed cycle will be adapted to Dynamic Economy or Full Economy modes.
To use dynamic economy cycles, the configuration needs to be extended by adding the following section:
dyneco_params:
reg_time_ms: 2.0 # ms
acceleration: 40000.0
duration_parabola_ms: 120.0
start_delay_ms: 50.0
load_ohms_ser: 50.0 # ohms
load_henrys: 6.7 # H
limit_v_pos: 26000.0
initial_ref: 155.7363 # A
dyneco_start_ct: 200.0
dyneco_end_ct:
SFT_PRO_MTE_L4780_2023_V1: 9500
SFT_PRO_MTE_L4780_2023_V2: 9500
SFT_PRO_MTE_L4780_2024_V1: 9500
SFT_PRO_MTE_L4780_2024_V2: 9500