Realtime Control Tools in the PSI Accelerator Control System
T.Blumer, D.Anicic, I.Jirousek, A.Mezger
Paul Scherrer Institut, Villigen, Switzerland
distribution of i/o into different lists. 10% random i/o (5devices per list), 40% repetitive i/o for averageapplications (10 devices per list) and 50% read i/o fordisplay and monitoring tasks (50 devices per list incompressed format).
Operation of the accelerator now loads the system to alevel of about 10 to 15% of the theoretical Ethernet
maximum load.

Abstract
The distributed control system for the PSI accelerators
provides optimized input output functions for closed loopcontrol. These basic functions are then used to build
generic applications for global online beam control. Someof these applications, including the basic mechanism used,
are explained. Questions about testing and the quality ofthese closed loop controls are discussed. Resulting
performance, timing and real-time response in the realsystem and under normal load are presented.

2 Control requirements
We have a need for closed loop control in many different
cases. To assist the operator in choosing optimal
parameters, good feedback for process identification,
optimization and troubleshooting is needed. The closed
loops have to observe numerous boundary conditions on
the loop parameters as well as other external parameters(interlock conditions). All parameters can be locatedanywhere in the control system.
The described control applications for closed loop
stabilization are generic applications that have evolved outof older specific programs. Based on the distibuted
control system, they are independent of the underlying
structure.
Any combination of parameters can be usedirrespectiveof the concerned Frontend. This application

1 General structure of control system
The PSI Accelerator Control System [1] implements a
distributed architecture. Frontend computers (FEC) provide
logical access to all accelerator devices. Workstations serve
as operator interfaces and minicomputers provide functions
like central data storage and accelerator data logging. The
whole communication is handled by a 10MBit Ethernet.
1.1 System performance
The following diagram (fig.1) shows maximum achiev
able values for input output (i/o) and communication
bandwidth throughout the different levels of the controlsystem. The estimation is based on the following

Workstation

Workstation

WorkstationEthernet 10 Mhz ( 90 % Load )to next
FEC

to next
WS≤ 10 %≤ 10 %

FEC
HPrt 743/64 Mhz

FEC
HPrt 743/64 Mhz
33k IO/s

24 %

24 %

33k IO/s≤ 10 %
M axim u m E thernet Performa nce :FEC
HPrt 743/64 Mhz
24 %33k IO/s

System total
60900 Devices/s

40 % 10 Devices/List (repetitive)è 150 List ⇒ 45 kByte

14900 Devices/s

10 %è 30 List ⇒ 12 kByte

1500 Devices/s

Total 112 kB yte

77300 D evices/s

5 Devices/List (random I/O)

CAMAC Loop
bit-serial 5MHz
7,8k IO/s

for one FEC

50 % 50 Devices/List (repetitive-compressed) è 120 List ⇒ 55 kByte

7,8k IO/s
CAN

CAMAC
Crate

Asynch.
Interface
10 %780 IO/s

ROAD-C

CAMAC
Crate
3,7k IO/s
to Control Unit’s
CAN, 1MHz

25k IO/s

Asynch.
Interface
10 %780 IO/s

to Control Unit’s
ROAD-C( 25 kHz | 24 bit parallel )FE C è CA M A C P er form ance (30 µs / C A M AC IO)
120 List x 50 Dev (RD)⇒ 6000 CAMAC IO

150 List x 10 Dev (RD)⇒ 1500 CAMAC IO

30 List x 5 Dev (RD/WR) ⇒ 300 CAMAC IO
Total 7800 C AM AC IO

to next
CAMAC Crateto next
CAMAC Crate

Fig.1 Graphical representation of the communication bandwidth through the different levels of the control systemstructure allows the use of CPU intensive control
algorithms while adding only a minimal load to theFrontend computers.
3 Closed loop control applications
During the development phase we also implemented aLABVIEW interface to our control system and tested their
PID controls package. The achieved results weresatisfactory but extension to multiple parameter operationand the addition of process identification favored a solution
entirely based on our own control system.
We normally use only the Proportional and the Integral
part of the classical PID control loop, the D part is usuallyneglected.
Linear dependency between input and output parametersof the controlled process is assumed and all active
elements are treated with one identical time constant. The
control loop is implemented according to the following
formula:[u] =G. [ M ] ( [e] - [e] +T /T [e]kinvkk-1

0k-1)

where [] represents vector notation, M the Transfer matrix,
T0 acquisition time, T integration constant, G gain, u
the increment to the output setpoint value and e the error at
iteration k.
An optimized communication uses only one message ineach direction for every execution of the loop. This
minimizes overhead and jitter. The control output is sent to
the FECs concerned, they then wait for the specified time
before returning the results of the feedback signals. The
new control output is then calculated and so on. Iteration
times of 50 ms can easily be achieved, however most loops
use an iteration frequency of 2-10 Hz.
Bumpless transfer is automatically achieved since we
use increments with the control value as reference insteadof a bias used in some systems.
All calculations are done with the internal machine float
resolution, the remaining differences to the integer output
values are accumulated and carried on for later iterations.
3.1 Generic application for systems with two input and twocontrol parameters
This closed loop control application is generic in thesense that the operator can freely configure all input output
parameters as well as the control characteristics of thesystem. The configuration may be stored and recalled forlater use. To help the user setting up the control loop,
three classical methods for process identification areincluded in the tool:
3.1.1 Ultimate gain method
By varying the gain, the system is put into a natural
sustained oscillation with the loop closed and with infinite
integral part. From this gain and from the oscillation period
we obtain the PI parameters as described in [2,3]. Thismethod gives fairly good results for simple cases where anoscillation can be obtained.

Fig.2 Application program showing a sustained oscillation
3.1.2 Step response method
By applying a step signal to the input of the system andby measuring the output signals, we obtain the dead time
and the time constant of the response. From these we
calculate the PI parameters as described in [2,3].

Fig.3 Measurement of the open loop step response of thesystem.
3.1.3 Bode plot method
Measurement of the open loop process response to avariable frequency sine excitation with determination ofamplitude and phase by Fourier transform. The result ispresented in the form of a Bode plot. This provides the user
with all the necessary information to achieve optimal
control characteristics. (fig.4)
3.2 Generic application for beamline orbit control
This application implements a closed loop orbit
correction algorithm and is used for all high intensity beamlines. The application uses different configuration files foreach beam line. The influence of the steering elements on
the beam position at the pickups is calculated using thetransport algorithm. This is done at startup and on request
to accommodate for varying beam optics. The obtainedtransfer matrix is then inverted and used in the closed loop.
The feedback signals are filtered at acquisition withintegrating characteristics.
Errors in this prediction are critical and lead to couplingof one steering element into all others. We use thefollowing method to detect these errors. In an online
correlation display we plot all concerned steering elements(y axis) against the element to be tested (x axis). While thethat look like butterflies, where the vertical amplitude is ameasure of the residual errors involved.

Fig.6 Error estimation of the transfer matrix, left sideshows reaction with error; right side with correct matrix.
4 Conclusions
Fig.4 Input and output signals with Bode plots

With the presented closed loop support we have createda set of versatile tools to control and stabilize theaccelerator. The present state of this development iscertainly not finished. We intend to further develop thefollowing fields:• Online process identification.
• Implement different time-constants on activeelements.
• Orbit correction with optimized fitting algorithm.
• Try algorithms like fuzzy control and other nonlinear control mechanisms.
Acknowledgments
We would like to take this opportunity to thank all ourcolleagues who have contributed to the success of thiscontrol system.

Fig.5 Orbit correction for beamline
correction loop is active, this element is disturbed. If theused transfer matrix is correct, the system willrecognizethe signature of this element and applies
corrections only there. With errors, other elements will also
be disturbed. Positive and negative excursions give figures

References[1] ICALEPCS’95[2] LabVIEW PID Control Toolkit reference manual.
[3] Digitale Regelungstechnik. F.W.Garbrecht, VDE
Verlag