SPEAR EPICS

BuckoMat - Automatic Bucket Injection

Introduction

The BuckoMat program, created by Leif Johnson and heavily modified by Stephanie Allison, provides automatic injection of booster beam into SPEAR buckets by controlling the LINAC chopper, SPEAR kickers, and the Booster RF phase bucket setpoint of the SPEAR3 bucket select sine generator chassis (Akre box) at the BTS toroid acquisition rate (maximum of 10 Hz). BuckoMat is an EPICS sequence and runs on the multi-use IOC, iocmu, in B117. The program is created from a state notation language file, multiUseApp/src/buckoMat.st. Records created specifically for BuckoMat are kept in multiUseApp/Db/buckoMat.db and are listed in the SPEAR EPICS PV Database "BUCKET" PVs (all record names start with "BUCKET:Select").

Operator Interface

The operations BuckoMat EDM display is available from the SPEAR index display. A snapshot:

This display shows the currently selected bucket, beam current (averaged over 1 sec), current interlock limit, BTS toroid value (average over 1 sec), and the BTS PR2 screen state. It also shows the status of Auto Fill (the program that automatically turns on BuckoMat during frequent fill), and the name and load time of the bucket pattern that BuckoMat uses to determine the next bucket to fill. When BuckoMat is in its wait state, the red text "Waiting for Pre-Inject Delay..." appears above the selected bucket. The rest of the display provides the following controls to the operator:

The injection limit, shutoff limit, current per bunch, machine mode, and auto fill state are all stored in the history database and restored when the ioc reboots. A reboot disables automatic injection, enables automatic shutoff, and leaves BuckoMat off. Related display buttons are also provided:

State Transition Diagram

The Buckomat sequence has 8 states as shown in the state transition diagram below.

Stopped State

The Stopped state does nothing except wait to go to another state. A transition is made to the Wait state when BuckoMat is switched on or auto-inject is enabled and the beam current is less than the inject limit. All of the following conditions must be true before the transition is allowed: A transition is made back to the Stopped state if the BuckoMat on request is rejected or if a BuckoMat pause is requested. A transition is made to the KickerOff state if the SPEAR kickers are enabled and the beam current goes over the maximum. A transition is made to the Select state when a reset pattern, bucket advance, or previous bucket request is made.

Wait State

The Wait state waits for a pre-injection delay (set on the injection detail display) and then transitions KickerOn state. If BuckoMat is switched off during the wait, a transition is made back to the Stopped state.

KickerOn State

The KickerOn state first inhibits the LINAC chopper SRS delay generator if needed. It then enables the SPEAR kickers and turns the chopper back on. If clears the BTS toroid ready event in order to synchronize with the next BTS toroid acquisition. It transitions to the Active state.

Active State

The Active state waits for the BTS toroid ready event, user request, or any condition requiring BuckoMat to go off. It transitions to the Select state when the BTS toroid ready event is set in the EPICS database. The BTS toroid ready event is generated after BTS toroid charge is acquired and if enough charge is accumulated to advance to the next bucket. The limit on the toroid charge accumulation can be set on the BTS toroid diagnostic display. The user can choose to ignore BTS toroid charge and just advance the bucket at 10hz by setting BTS toroid flag to NO on the injection detail display. A delay before the BTS toroid ready event is generated can be tuned from the injection display so that the bucket selection is done at the proper time with respect to the booster RF.

A transition is also made to the Select state when a reset pattern, bucket advance, or previous bucket request is made. A transition is made to the Paused state if BuckoMat is paused by the user.

A transition is made to the KickerOff state under any of these conditions:

If BuckoMat is switched off, auto-inject is disabled.

Paused State

The Paused state does nothing except wait to go to another state. A transition is made to the Active state if any of the following conditions occurs: A transition is made to the Select state when a reset pattern, bucket advance, or previous bucket request is made.

Select State

The Select state determines the next bucket to be filled and sets the bucket selection in Akre chassis. If a user request has been made, it honors the request: If a user request is not made, the next bucket is automatically found by either advancing to the next non-zero bucket in the sequence or setting a mondo bucket (bucket with value greater than one in the pattern) if it is ready. Mondo bucket fills are evenly spaced among all active buckets so that the charge is kept constant. Once a cycle is finished and all buckets (regular and mondo) are filled, a rollover is done to the start of the pattern and the sequence restarts.

Once the bucket is set, a transition is made back to the previous state (Active, Paused, or Stopped).

KickerOff State

The KickerOff state first inhibits the LINAC chopper SRS delay generator. It then sets the BuckoMat Off PV, resets the Paused PV, and disables auto-injection if needed. If the BTS toroid is not being used, it waits 0.2 seconds and then disables the SPEAR kickers and transitions to the Stopped state.

If the BTS toroid is used, it waits for the next BTS toroid acquisition and checks if the toroid indicates there is still beam, ignoring the first value to give time for the chopper to turn off. If there is still beam, it is assumed that the chopper cannot be turned off for some reason. In this case, if the flag to insert the PR2 screen is set to YES on the injection detail display, the BTS-PR2 screen is inserted. a one second delay is done, the SPEAR kickers are disabled, and a transition done to the Stopped state.

If the BTS toroid is used, as long as the toroid indicates no beam, a transition is done back to the KickerOff state until enough time has passed to be sure there is no beam, depending on chopper rate and a transition done to the Stopped state.

Init State

The Init state initializes all buckomat variables and passes on to the Active state. This state is never entered again.


SPEAR EPICS | EPICS Home | SPEAR Home | SSRL Home | SLAC Home

Contact: Stephanie Allison
Last Modified: May 22, 2013