Automation - Low Level Radio Frequency Workshop 2015 LLRF`15
Download
Report
Transcript Automation - Low Level Radio Frequency Workshop 2015 LLRF`15
Wir schaffen Wissen – heute für morgen
Automation in LLRF System
Zheqiao Geng
Paul Scherrer Institut (PSI), Switzerland
For LLRF15 Workshop, Shanghai, China
Nov. 3, 2015
Outline
Introduction and Motivation
Automation in LLRF System
A Systematic Concept of Automation
Implementation of Automation
Summary
2
Introduction and Motivation
3
Definition
Automation or automatic control, is the use of various control systems for
operating equipment such as machinery, processes in factories, boilers and heat
treating ovens, switching on telephone networks, steering and stabilization of
ships, aircraft and other applications with minimal or reduced human intervention.
- Wikipedia
Applying to Accelerator RF Systems:
LLRF Automation is the use of LLRF control system for operating the RF system
with minimal or reduced human intervention.
4
Recall A Typical RF Station
Basic Functions of LLRF System:
• Measure the RF field seen by
beam accurately and precisely.
• Provide correct and clean drive
RF to pre-amplifier. It may be a
result of a feedback controller.
• Implement interfaces with other
subsystems to control or monitor
them.
Automation will be built upon the basic functions!
5
Goals for Automation of an RF Station
Ultimate Goals:
This is a dream!
Realistic Goals:
Facilitate the operators to operate the RF/LLRF systems by
Automating the low level parameters optimization and settings
Automating the procedures to setup or adjust the RF station
Improve the RF stability by implementing slow feedbacks or feed forward (e.g.
adaptive feed forward).
Improve the visibility of the RF system with complex system status detection
and derived measurements.
Improve the robustness of the RF system by providing complicated exception
6
detection and handling.
Automation in LLRF System
7
Automate the Group Parameter Settings
A lot of registers in firmware and basic parameters in software need to be set
under different working conditions. Setting the values of them as a group will be
helpful. The parameter setting here is straight forward mainly related with working
conditions.
Examples:
Set up the ADC/DAC/Clock chips during startup.
Set a group of parameters or registers when changing the RF station from beam
operation mode to RF conditioning mode, for which, the repetition rate, pulse
shape or operation limits may be different.
8
Automate the Atomic Processes
The atomic processes are operations which are more or less not interruptible and
will be finished in short time. The processes are normally based on the initial
measurements and the output can be derived characteristic values of the RF
system or optimal values for some parameters.
Examples:
Derived measurement: measure quality factor and detuning of cavities
Optimization: optimize quality factor, feedback gain
Calibration: calibrate vector sum, drive power, cavity voltage, beam phase
Feedback: iterative pulse shape control; cavity tuning control
9
Automate the Complex System Processes
System processes are operations to implement complex procedures which may
take long time to finish or can be interrupted and resumed by the user during
execution. Normally one or more atomic processes will be executed in a system
process.
Examples:
RF station starting up or stopping
High power RF components conditioning
Systems status checking and automatic fault recovery
10
Automate the Control of Multiple RF Stations
To fit into the global control context of the accelerator, multiple RF stations,
especially the ones within the same section, need to be operated in a coordinated
way.
Examples (for Linac):
Set the overall energy gain and beam phase for a section of accelerator.
Optimize the energy gain distribution for different RF stations to maximize the
energy headroom and improve the overall reliability (e.g. energy gain limited by
cavity quench limit).
Compensate the failed cavity or failed RF station.
11
Hierarchy of Automation – Functions
Multiple RF Station Control
Automation
Individual RF
Station Control
…
Individual RF Station Control
Automation
of Atomic
Processes
Setting a group of
parameters can
also be viewed as
an atomic process
Execute one or
more
Automation
of System
Processes
Automation
of Group
Parameter
Settings
12
A Systematic Concept of Automation
13
Automation Concepts
Job
System Process
Operation Mode
Virtual RF Station
Complete View of Automation Concepts
14
Job
Atomic processes including group parameter setting can be modeled as “Job”.
A Job will be controlled by an event (can be user command, a timer or a command
from system processes), take some inputs, executed with some parameters and
generate some outputs.
Most of the algorithms related with RF domain knowledge (e.g. cavity model,
feedback model and RF signal processing) will be implemented in the Jobs.
Control: Start,
Pause, Stop, Reset…
Inputs
Job
- Execute Domain
Algorithms
Outputs
Parameters
15
Job Example 1: Correct DAC Offset
Goal: Remove the carrier leakage from vector modulator
Control: Started by user clicking a button
Inputs: Current DAC waveform; current measurement of vector modulator output
Parameters: Calculation region in the pulse
Outputs: Offset correction of DAC
16
Job Example 2: Identify I/Q Imbalances
Goal: Qualify the amplitude and phase imbalances of vector modulator
Control: Started by user clicking a button
Inputs: I/Q averages of DAC output and vector modulator output for each scan step
Parameters: Phase scan start and step values
Outputs: I/Q imbalances, amplitude and phase actuation errors
17
A List of Typical Jobs
Generate tables for pulsed operation (set point, feed forward …)
Correct DAC offset
A LLRF algorithm
Calibrate the loop phase and loop gain
library can be
Calibrate the vector sum (for vector sum control)
very helpful to
implement the
Calibrate the cavity drive/reflected power
jobs!
Calibrate the cavity voltage and beam phase
Identify the cavity quality factor and detuning
Optimize the relative phase between cavities (for vector sum control)
Optimize the quality factor of cavities (for vector sum control)
Optimize the feedback gains
Adapt the feed forward
Control superconducting cavity Lorenz force detuning
Control normal conducting cavity detuning – with cooling system or others
……
18
Automation Concepts
Job
System Process
Operation Mode
Virtual RF Station
Complete View of Automation Concepts
19
System Process
A system process will execute multiple jobs. The execution can be in two typical
patterns:
Sequential: The system process can be modeled as a procedure.
State Dependent: The system process can be modeled as a Finite State
Machine (FSM).
Start
Inputs x
Param x
Inputs 1
Param 1
Job 1
Outputs 1
State 1
Entry/Do/Exit
Job x
Outputs x
Inputs z
Outputs z
Job z
Inputs 2
Param 2
Job 2
Outputs 2
……
Inputs n
Param n
Job n
Param z
State 2
Entry/Do/Exit
Outputs n
Inputs y
Param y
End
Job y
Outputs y
20
System Process Example 1: RF System Startup
stm Oprational States
Initial
Execute Jobs:
- Check system status
- Correct DAC offset
1. Off
cmd
[modulatorFailed]
cmd
2. Modulator Waiting
Execute Jobs:
- Determine and set klystron high
voltage and drive
[modulatorInStandby]
3. Standby
cmd
cmd
interlock [RF_RDY=1]
interlock [RF_RDY=0]
[systemNotOK]
4. System Validating
Execute Jobs:
- Calibrate loop gain and loop
phase
- Adaptive feed forward
[systemOK]
5. Ready for RF Power
interlock [RF_RDY=0]
interlock [RF_RDY=1]
cmd
[RFPowerNotReached]
cmd
6. RF Power Ramping
Execute Jobs:
- Recover from RF fault trips
[RFPowerReachesSP]
7. RF Power On
interlock [RF_RDY=0]
interlock [RF_RDY=1]
cmd
[Amp/Pha/PulShapeNotOK]
cmd
RF Fault
8. RF Optimizing
[AmpPhaPulShapeOK]
9. RF Ready Off Beam
interlock [RF_RDY=0]
interlock [RF_RDY=1]
cmd
cmd
10. RF Ready On Beam
interlock [RF_RDY=1]
interlock [RF_RDY=0]
Automatic parameter setting:
- Set modulator state
- Set interlock system mode
- Set RF switch on/off
- Set feedback on/off
- Set trigger delays
21
System Process Example 1 (cont.)
Display the current
state and transfer
status.
Set target state
22
System Process Example 2: High Power RF Conditioning
stm Conditioning Tool
RF On
do / Ramp HV and Power
Courtesy: Alex
Jürgen, PSI
[Interlock Trips]
/Set Modulator to Standby State,
Change Ramp Speed
[Unknow Exceptions]
/Set Modulator to Standby State
[Modulator in Trigger State And HV Reached]
Break Dow n
Modulator On
Initial
Init
entry / Connect Channels
[All Channels Connected]
Cmd RF On [Modulator in Trigger State]
entry / Put Modulator to Trigger State
[After 5s]
[Timeout]
[Modulator ILK OK And in Standby State]
Error
Clear Errors
[Timeout]
entry / Reset Modulator Errors
[Vacuum OK]
Wait Ready
Cmd Reset FSM
entry / Set Modulatore HV Dest.
Off
[Vacuum Not OK within Timeout]
Cmd RF On [Modulator Not in Trigger State]
23
System Process Example 2 (cont.)
Courtesy: Alex
Jürgen, PSI
24
Automation Concepts
Job
System Process
Operation Mode
Virtual RF Station
Complete View of Automation Concepts
25
Operation Mode
An operation mode identifies a recognized working situation of the RF system.
Defining the operation modes helps to set the RF system to a specified working
scenario with simple commands.
When entering an operation mode:
- A group of parameters will be set to specified values.
- Some Jobs will be enabled or disabled.
- For system processes, different states can be reached.
26
Operation Mode Example 1: SwissFEL RF Station Mode
stm Modes
Initial
DIODE
SHUTDOWN
ILK Key Changed
[Load Key Enabled]
cmd
cmd
RF-OFF
ILK Key Changed [Load
Key Enabled]
ILK Key Changed
[Diode Key Enabled]
LOAD
ILK Key Changed
[Norm/Cond Key Enabled]
cmd
cmd
NORMAL OPERATION
cmd
cmd
cmd
CONDITIONING
cmd
27
Operation Mode Example 2: iPhone Flight Mode
With one button:
- Wi-Fi, Bluetooth and cellular connections are
disabled.
- No longer be able to make or receive calls, texts, or
e-mails, or browse the Internet …
28
Automation Concepts
Job
System Process
Operation Mode
Virtual RF Station
Complete View of Automation Concepts
29
Motivation
In a Linac based FEL machine, beam physicists usually adjust the phase and
amplitude of a group of RF stations simultaneously in main Linac.
SwissFEL
LCLS
30
Virtual RF Station Concept
Appear as a single RF station to the user!
- User reading: amplitude and phase of VRF, the vector sum.
- User writing: amplitude and phase set point of VRF.
K4
VRF Station Controller
K3
Individual
RF Station
Controller
Individual
RF Station
Controller
Individual
RF Station
Controller
Individual
RF Station
Controller
K2
K1
K1
K2
K3
K4
Beam
ACC
ACC
ACC
ACC
31
Virtual RF Station Planned for SwissFEL
Determine individual RF station amplitude and phase set points based on the overall energy
gain and beam phase settings.
Calculate the total energy gain and beam phase of the VRF station with the vector sum of
individual RF stations.
Simplify the interface between LLRF system and global beam based feedback system.
Compensate the failed RF stations if there are enough energy gain headroom in other RF
stations.
32
Automation Concepts
Job
System Process
Operation Mode
Virtual RF Station
Complete View of Automation Concepts
33
Hierarchy of Automation – Models
Multiple RF Station Control
Automation
Virtual RF
Station
Individual RF
Station Control
…
Individual RF Station Control
Operation
Mode
Configure
Setting a group
of parameters
can also be
viewed as a Job
Job
Configure
Execute
one or more
System
Process
Execute
Group
Parameter
Setting
34
Implementation of Automation
35
Implementation of Automation
Requirements and General Architecture
Automation Tools in Popular Control Systems
Automation Implementation for SwissFEL LLRF
36
Identify Jobs from Description of Use Cases
The use cases describe how the RF system should be operated with the
LLRF system. By describing use cases, the jobs can be easily identified by
marking up the key words potential for automation.
Example: Close feedback loop of an SC RF station
1.
2.
3.
4.
5.
Tune the cavities with motor tuners to have optimal pre-detuning.
Switch on the piezo tuner to compensate the Lorenz force detuning.
Calibrate the vector sum.
Correct the loop phase and loop gain.
Close the feedback loop.
Complex use cases are candidates of System Process!
37
Architecture of Individual RF Station Automation
Choice 1: A single software process to implement all functions – operation
modes, system processes and jobs.
Choice 2: Use multiple software processes for jobs, system processes and
operation modes. They can also be distributed in different CPUs.
Individual RF Station Automation
Process
System
processes can
be implemented
as threads
Operation
Mode Control
System
Process 1
System
Process 2
…
Job 1
Job 2
…
System
Process
m
Job n
Manager Process
The manager
process is used
to manage other
processes.
Operation
Mode Control
System Proc.
Process
System Proc.
Process
System
Process 1
System
Process 2
Job Process
Job Process
Job 1
Job 2
System Proc.
Process
…
System
Process n
Job Process
…
Job n
38
Implementation of Automation
Requirements and General Architecture
Automation Tools in Popular Control Systems
Automation Implementation for SwissFEL LLRF
39
EPICS Sequencer
A tool to run programs written in State Notation Language (SNL). SNL is a “C” like
language to program FSMs. The SNL maps well to the UML state diagrams.
With built-in Channel Access client to communicate with device controllers.
No GUI based state diagram editor.
stm Lev el Check
Initial
light_off
Voltage Changes
[voltage > 5.0]
/Turn on light
Voltage Changes
[voltage < 5.0]
/Switch off light
light_on
40
DOOCS FSM
FSM editor provides GUI for definitions of states and transitions.
C++ code framework will be generated from the state diagrams and the user can
input custom routines, compile and run the FSM.
41
LabVIEW Statechart Toolkit
A state diagram editor can be used to create state charts and generate LabVIEW
code framework.
42
Customized Automation Framework at PSI (OOEPICS)
class ooEpics Classes - applications
Module_Config
Implements functions
to create and set up
HLA modules
+manage modules via
Module_Manager
+register module
type and module
instance
0..*
+configure
Top class for a
module of high
level application
Module_Body
Application
+contain
Thread
0..*
0..*
+CA
event
0..*
+local PV
process
event
Each Local PV is a
EPICS record
which can be
defined in other
objects.
+contain 0..*
Local_PV
Coordinates
execution of Jobs:
Job registered
with a code
Job executed by
a event with the
same code
0..*
+contain 0..*
+drive
Coordinator
0..*
0..*
Collects all
functions to
monitor and control
a remote device.
0..*
0..1
0..*
0..*
0..*
+control
remote
device via
Job
FSM
0..*
0..*
Serv ice
0..*
+access
remote
IOCs via 0..*
Also implements the
mechanism to execute
a FSM.
Remote_PV
Read and write a remote
PV with CA. PV name get
from a map file.
0..*
Channel_Access
43
Implementation of Automation
Requirements and General Architecture
Automation Tools in Popular Control Systems
Automation Implementation for SwissFEL LLRF
44
General Remarks
EPICS is used as the control platform in SwissFEL LLRF system.
Automation of an individual RF station is implemented in a centralized process as
a soft IOC. The software runs in the CPU of the LLRF FPGA board close to the
data source to reduce the network traffic.
An library in C language is used to implement all RF and control domain
algorithms.
45
Software Architecture of SwissFEL LLRF HLA
EPICS Database Interface
· Set parameters and display results
· Generate events to drive the Execution Coordinator
events
results
results
Execution Coordinator Thread
events
Operation Mode
· RF off
· Normal Operation
· Conditioning
parameters
Job
System Process
Diagnose RF system status
Ramp RF power
Iterative Learning Control
Calibrate loop gain & phase
Identify cavity parameters
(detuning / QL)
·
...
Startup/shutdown RF
station
(Finite State Machine)
...
LLRF
Algorithm
Library
·
·
·
·
·
· Diode Mode
· Load
· Calibration
parameters
Classes
derived from
the OOEPICS
framework.
Service
·
Abstract routines to monitor and control remote devices
(e.g HV modulator)
EPICS Channel Access Interface
· Read and write EPICS process variables (local/remote IOCs)
· Monitor PVs and generate events
46
LLRF HLA at SwissFEL C-band Test Stand
47
Virtual RF Controller Functions
48
VRF Control Hardware
Architecture
IFC1210
IFC_TC2
FM-S14
49
Summary
50
Summary
Automation is very important for the operations of a complex RF system. It is one
of the key functions that the LLRF system should provide.
There are big freedom to implement the automations. A systematic consideration
is helpful to keep the implementation clean and clear.
To which level the automation should be implemented is a compromise
considering the following issues:
Available man-power
Development difficulties
Maintenance cost
51
The End!
Thank You!
52