BuckoMat - Automatic Bucket Injection
IntroductionThe 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 InterfaceThe 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:
- Switch BuckoMat On and Off. Buckomat does not allow the On state until beam current is below the maximum limit (currently 500mA), beam current is below the auto-shutoff limit or auto-shutoff is disabled, and all PVs on other IOCs are connected.
- Pause BuckoMat. Stops control of the booster bucket selector.
- Buttons to manually enable or disable the SPEAR kickers (operators in the control room will see the blue kicker light go on or off when this button changes) and manually set or clear the LINAC chopper delay generator inhibit line. Note that BuckoMat performs these actions in the proper order (to minimize beam spray) while transitioning on or off so operator control is normally not required.
- Enable or disable automatic injection. When enabled, Buckomat automatically goes on when the beam current goes below the injection limit.
- Set the injection limit using a slider or text entry.
- Enable or disable automatic shutoff. When enabled, Buckomat automatically goes off when the beam current goes above the shutoff limit.
- Set the shutoff limit using a slider or text entry. This limit is stored in the history database and is restored across IOC reboot.
- Restart the pattern or force a bucket advance or retreat.
- Choose the machine state.
- Choose the auto fill state.
- Set the allowed current per bunch using a slider or text entry. If zero, then the next bucket selector is triggered after a delay corresponding to the currently-selected chopper rate delay, independent of beam current.
- Auto Fill Detail - expert control and status for the Auto Fill program.
- Injection Detail - expert control parameters for BuckoMat.
- Active Pattern - pattern currently in use by BuckoMat, showing the specific buckets (out of 372 buckets total) that are being filled and any mondo buckets (buckets with higher charge).
- All Patterns - all patterns currently set up by operations and buttons to load a different pattern into the active pattern.
State Transition DiagramThe Buckomat sequence has 8 states as shown in the state transition diagram below.
Stopped StateThe 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.
- Beam current is less than the maximum limit
- All PVs on other IOCs are connected
- Auto-shutoff is disabled or beam current is less than the shutoff limit
Wait StateThe 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 StateThe 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 StateThe 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.
- SPEAR kickers are enabled and beam current goes over the maximum limit
- BuckoMat is switched off
- Auto-Shutoff is enabled and beam current or estimated beam current is greater than the shutoff limit
Paused StateThe 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.
- SPEAR Kickers are enabled and beam current goes over the maximum limit
- BuckoMat is switched off
- Pause is cancelled
Select StateThe 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.
- Pattern restart - finds the first non-zero bucket of the 372 buckets in the pattern.
- Bucket Advance - finds the next non-zero bucket in the current sequence.
- Previous Bucket - finds the last non-zero bucket in the current sequence.
Once the bucket is set, a transition is made back to the previous state (Active, Paused, or Stopped).
KickerOff StateThe 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 StateThe 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