A DIGITAL SYSTEM FOR LOCAL ORBIT
STABILIZATION AT ELETTRA
D. Bulfone, A. Galimberti, D. Giuressi, M. Lonza, C. Scafuri
Sincrotrone Trieste, SS 14 - Km 164.5, 34012 Basovizza, Trieste, Italy
Abstract
ELETTRA is the Italian third generation synchrotron radiation source operating in Trieste since October 1993. The high-brightness photon beams generated by the facility are routinely used to perform a wide variety of experiments in chemistry, biology, material science, medicine, etc. To take full advantage of the collimated photon beams a very high level of stability is requested for the accumulated electron beam which produce them. The paper describes the local orbit feedback system which has been developed in order to stabilize the electron orbit at each photon source point. Digital signal processing techniques are used for the system controller, which is based on VME boards equipped with the TMS320C40 DSP. The software tools developed to operate both the DSP and the feedback components from the Matlab environment are also described.
1 INTRODUCTION
Fig. 1 is a schematic representation of the facility. After being accelerated by a linear accelerator, an electron beam is guided along the transfer line and finally injected and accumulated into the storage ring. 24 bending magnets keep the
2 GeV stored electron beam on a nearly-circular trajectory inside a 260 m long ultrahigh vacuum pipe. Other magnets (correctors, quadrupoles and sextupoles) are used to steer, focus and provide the right optics to the electron beam.

Fig. 1: The schematic layout of a synchrotron radiation facility
Four Radio Frequency (RF) cavities supply the energy lost by the electrons when emitting photons. Different types of instrumentation measure the main beam parameters like position, current, etc. All the machine equipment is connected to a distributed control system which allows to monitor and control the whole machine from a control room. The electromagnetic radiation emitted by relativistic charged particles moving on a curved trajectory is called "synchrotron radiation" [1]. The curvature of the trajectory is provided by external magnetic fields. In a "third generation" light source like ELETTRA, special magnetic structures called Insertion Devices (ID) are used to wiggle the electrons and to produce collimated photon beams with unprecedented brightness in the VUV and soft X-ray range. These beams are conveyed along the so called beamlines where a number of users perform a wide variety of experiments in chemistry, biology, material science, medicine, etc. The full exploitation of the high brightness photon beams relies on the transverse stability of the electron orbit at the ID source points. This implies a very tight tolerance on both the position and the angle of the electron beam trajectory inside the ID, down to a few microns and a few micro-radians in our case. Sources of beam instability could be electrical (e.g. noise from the mains coupled through the magnet power supplies) or mechanical (e.g. ground vibrations). Typical noise spectra range from 1 to 100 Hz.
In order to achieve the requested performance, active orbit feedback systems are used [1]. At ELETTRA, a fast Local orbit Feedback (LF) has been developed and is now installed on two of the ID sections [2].
2 system layout
The layout of the ELETTRA LF system is shown in fig. 2. A couple of dedicated photon Beam Position Monitors (phBPM) and four steering magnets driven by separate power supplies act respectively as sensors and actuators. The phBPM signals are sampled by A/D converters and processed by a Digital Signal Processor (DSP) based system which implements the control algorithm. The D/A converters re-transform the resulting output samples in analog signals which drive the power supplies of the steering magnets. An Ethernet connection allows to communicate with the control room workstations and to remotely control the DSP operation.

Fig. 2: The local feedback layout
2.1 The Photon Beam Position Monitors
The two phBPMs [3] are located inside the beamline. They are 1 m far from each other and the first one is 9 m far from the corresponding ID centre. Excellent performance in terms of mechanical stability has been achieved. The operation of the monitors is based on the photo-emission effect of four tungsten blades spaced 90
0 from each other. Their particular configuration allows to intercept only the fringes of the photon beam and to sustain the radiation flux and the thermal load. The two monitors are rotated by 450 one respect to the other (fig. 3) so that the shadow of the first set of blades does not fall on the blades of the second monitor. The signals from the blades are pre-processed by high precision electronics which provides sub-micron sensitivity. They are then conditioned and amplified in order to assure good noise rejection in the transmission to the acquisition boards. In order to avoid non-linearities and cross-talk between the two planes the centre of the photo emitting blades must be placed close to the centre of the photon beam: a motorised x-z translation system has been developed for this purpose.
Fig. 3: Photon BPM schematic layout
The position values are calculated by the DSP Controller. In the case of the first phBPM, the positions are:

Formulae are a little more complicated for the second phBPM:

If we plot the calculated position against the true beam position, we obtain a hyperbolic tangent like curve; however, in its central part, this curve can be very well approximated by a straight line.
2.2 The Corrector Magnets
A corrector magnet generates a magnetic field which deflects the electron beam orbit by an angle proportional to the field strength. The ELETTRA storage ring has 164 corrector magnets (82 horizontal and 82 vertical) and each of them is driven by a dedicated power supply. Each LF system uses four corrector magnets per plane.
In order to operate multiple LFs at the same time, these have to be de-coupled from each other. This can be achieved by using two corrector magnets upstream and two downstream of the ID so that a "local orbit bump" is generated. The bump is then manipulated to obtain the desired beam position at the phBPMs. Let us call X
(2) the vector of the desired positions measured at the phBPM and (4) the vector of the corrector settings that moves the photon beam by X and satisfies the locality condition: can be calculated as
(4) = B(4x2) . X(2)where B
(4x2) is the so called "bump matrix".An empirical approach has been adopted to calculate B
(4x2).
Fig. 4: Block diagram of the correction scheme showing the bump matrix de-coupling action
By exciting separately the four correctors and measuring the corresponding global orbit change and the phBPMs positions, B
(4x2) can be determined [4] using the Singular Value Decomposition (SVD) algorithm [5]. The bump matrix transforms the four-input (correctors) by two-output (phBPMs) system into a two-by-two system with de-coupled channels where the control algorithm is independently applied (fig. 4).2.3 The DSP based Controller
The Controller is based on the VME bus standard (fig. 5). The eight analog signals coming from the two phBPMs are conditioned and filtered to avoid aliasing effects by a home-developed board with 4th order low-pass filters. The same board provides also filtering and conditioning for the eight output analog signals going to the power supply cabinet. A Pentek board model 6102 is in charge of the A/D-D/A conversions. It features a maximum rate of 200 ksamples/s on each independent channel with a resolution of 16 bits. We sample at 8 kHz. The DSP board is a Pentek 4284 with one TMS320C40 processor at 50 MHz which runs the correction algorithms on both the vertical and horizontal planes at a repetition rate of 8 kHz. An additional CPU board with a Motorola 68030 microprocessor acts as a bridge between the DSP and Ethernet. The A/D-D/A and the DSP boards are connected by a mezzanine bus (Modular Interface eXtension, MIX), while the VME bus is used for the communication between the DSP and the bridge board. The MIX bus is an open, non-proprietary standard adopted by Pentek for fast inter-board communication, leaving the VME bus free for other purposes. The programs running in the DSP are written in "C" language. A complete development environment and a special Ethernet communication protocol called respectively SwiftTools [6] and SwiftNet [7] (by Pentek) allow to compile, download, run and debug the programs in the DSP from UNIX workstations.
3 The Matlab Framework
A set of Matlab commands implemented as MEX-files [8] allows to remotely operate the DSP directly from the workspace. Another set of MEX commands interfaces Matlab to the general Control System of the accelerator.

Fig. 5: Schematic of MADE
3.1 Matlab DSP
environment (MADE)The LF project has been supported through all its phases by an effective Matlab based workbench developed at ELETTRA, called MADE (MAtlab-Dsp Environment). The link between Matlab and the DSP relies on SwiftNet, the communication protocol made by Pentek. It includes an Application Program Interface (API) library linkable to the C language MEX-files which allows to implement a client-server communication with a Server program running on the DSP (fig. 5). The UNIX workstations running Matlab and the DSP systems are connected by an Ethernet LAN: each DSP is identified by a unique node name.
The MADE commands are divided in two groups: general purpose commands and LF dedicated commands. The general purpose commands allow to:
• set-up the I/O boards (sampling frequency, anti-aliasing analog filters, etc.)
• acquire input/output signals
• generate output wave-forms (sinus, square, white noise, arbitrary wave-forms)
• acquire data pre-processed by the DSP (spectra, statistics, frequency responses, etc.)
• set-up digital filters.
The LF dedicated commands allow to:
• control the calculation of the photon beam position from the blade signals
• set the bump matrices
• set-up a slow monitoring of the positions vs. time by averaging the fast I/O signals, even during the control algorithm execution, and read the stored arrays of data
• set-up the control algorithms
• open/close the loop
• read the status of the controller.
Each MADE MEX-file is associated with a server routine which is executed when the command is issued from Matlab. Any of the DSP systems connected to Ethernet can be addressed from the same Matlab session by simply changing a workspace string variable, called "TARGET", that contains the node name.
The MADE Server program has been written for the Pentek 4284 DSP board and three different Pentek I/O boards (models 6102, 4243 and 4252). The hardware dependent part of the program, represented by a few C functions, can be easily modified to fit any other Pentek CPU or I/O board.
MADE will be soon available also as a linkable library for the development of C language application programs.
3.2 Integration of Matlab in the ELETTRA Control System
The ELETTRA Control System is a distributed computer system based on a layered architecture (fig. 6).

Fig. 6: Architecture of the ELETTRA distributed Control System
Programs running at the presentation layer interact with the local processing level by means of a collection of Remote Procedure Call (RPC) libraries.
The integration of Matlab in the ELETTRA Control System is based on the existing RPC libraries for general accelerator control and on standard UNIX services (fig. 7). The specific control libraries which are made available in the Matlab environment are the basic "equipment access library" and the "beam orbit library".

Fig. 7: Software layers for the integration of Matlab in the ELETTRA Control System
The equipment access library allows to read/set values from/to the machine equipment. Each equipment is identified by a name which is a simple character string. The library calls automatically perform all the network connection steps. First of all a Network Information System database (NIS - formerly yellow pages) is queried to find the network address of the "configuration server". This provides the network address of the local processing computer handling the named equipment. The connection to the field is finally established using this address and the remote procedure is called. Although this scheme seems rather involved, it has good response times and proved to be extremely robust and easy to use. The last point is very important since the Matlab functions are mainly used in an interactive environment.
The beam orbit library allows to read the beam displacement from the ideal orbit around ring at the location of 96 electron beam position monitors. The technique used for the integration of this library is identical to the previous case.
4 System modelling and simulation
The feedback set-up allowed a quick and effective dynamic characterisation of the overall chain made up of the power supply, magnet, vacuum chamber and phBPM. The frequency response of the system has been measured on the real machine by modulating one vertical corrector with sinusoidal signals at different frequencies generated by the DSP and acquiring the beam oscillations detected by the phBPMs with the DSP itself.
The dynamic behaviour of the chain is dominated by the corrector magnet and power supply. Using the invfreqz algorithm from the Signal Processing Toolbox a polynomial model in z has been calculated which best fits the frequency response of the system: a third order model is sufficient to characterise it up to 200 Hz. Fig. 8 shows the response of the model compared with the real one.
Fig. 8: Frequency response of the real system compared with the third order model
Starting from this model several simulations have been carried out using both Matlab and Simulink to better understand the closed-loop behaviour of the system. The model block diagram is shown in fig. 9.

Fig. 9: Block diagram of the model used to simulate the closed-loop system behaviour
The delay represents the time lag due to the processing and conversion time: it is estimated to be equivalent to two samples, which means 250 ms at the nominal 8 kHz sampling rate. The controller implemented for the first tests is a Proportional Integral Derivative (PID) [9] standard regulator with transfer function:

A first-order low-pass filter with cut-off frequency fc has been added before the PID in order to limit the dynamics of the signal at the higher frequencies and to avoid non-linearity of the power supply. As the sampling frequency is much higher than the working frequencies, the model does not take into account the anti-aliasing or the reconstruction analog filters. Fig. 10 is an example of the simulated frequency response of the closed-loop system and the corresponding open-loop Nyquist diagram.
Fig. 10: Closed-loop frequency response and open-loop Nyquist diagram of the simulated system
(K
5 First operation and results
The behaviour of the closed-loop on the machine is in good agreement with simulations. Fig. 10 shows the measured spectra before and after closing the loop. The PID parameters (K
P, KI, KD) as well as the low pass filter cut-off frequency fc have been empirically determined with the aid of the model to optimise the response in the range 0 - 200 Hz. Attenuation of about 9 dB of the 50 Hz component, 6 dB of the 100 Hz and 3 dB of the 150 Hz have been obtained and confirm the predictions given by simulation on the model.
Fig. 11: 0-200 Hz noise spectra with loop open and closed (K
P=3, KI=0.01, KD=10, fc=150 Hz)6 The harmonic suppressor
A newly implemented technique, called "harmonic suppression", has been applied to damp the 50 Hz component and its harmonics, which can be clearly identified in the beam position spectrum acquired by the phBPM. The noise components are periodic and stable, therefore it is possible to effectively work also at frequencies much higher than the open loop cut-off frequency. The harmonic suppressor scheme is shown in fig. 12; it consists of a feedback with a selective digital filter centred at the frequency to damp. The delay is calculated in order to get an overall system open-loop rotation of 360
0 at the chosen frequency. In practice the closed-loop system realises a notch filter whose depth is regulated by the programmable gain.
Fig. 12: Harmonic suppressor scheme
The filter is a complex-conjugate two pole digital resonator with zeros at z=
±1; the transfer function is [10]:
If r<1 the resonator is stable; 0 is the resonance frequency.
Fig. 13: open/closed loop spectra with a PID regulator together with one harmonic suppressor
(0=2.50 Hz, r=0.99995 and gain (at 0) = 100)
By properly setting the coefficient r it is possible to change the bandwidth of the notch which must be effective only at the selected frequency. In fact, the results of simulations show that, as long as the notches are completely separated from each other, it is possible to implement multiple harmonic suppressors centred at different frequencies working in parallel with a standard PID regulator. The first tests on the machine with a single harmonic suppressor associated to a PID have been carried out with success. Fig. 13 shows that the 50 Hz oscillation can be completely eliminated.
7 Conclusions
A fast local orbit feedback system has been developed and implemented on two of the ELETTRA beamlines. An empirical method has been developed for the generation of the bump matrix. First closed-loop tests have been performed using a standard PID regulator and an attenuation bandwidth of 0-150 Hz has been achieved. The results are in good agreement with the simulations. Persistent harmonic components of the beam noise have been effectively damped by dedicated harmonic suppressors. The concurrent utilisation of the above techniques should provide the best way to counteract the beam noise spectra measured at ELETTRA.
The whole design and implementation of the digital feedback system has been carried out using Matlab. The interpreted environment allowed to quickly perform experiments and measurements, turning raw numbers into meaningful data and graphs with minimum effort. The friendliness of use of Matlab had also the invaluable effect of stimulating people to try new ideas immediately. The overall development time was greatly reduced.
REFERENCES
[1] H. Winick: 'Synchrotron Radiation Sources, a Primer', World Scientific, 1994.
[2] C. J. Bocchetta et al.: 'The Design of the ELETTRA Fast Local Feedback System', Proc. PAC97, Vancouver, BC, Canada, 1997.
[3] A. Galimberti et al.: 'Photon Beam Position Monitors suitable for a Local Feedback System at ELETTRA', Proc. 5th EPAC, Sitges, Spain, 1996.
[4] C. J. Bocchetta et al.: 'First Operational Results with the ELETTRA Fast Local Feedback System', Proc. PAC97, Vancouver, BC, Canada, 1997.
[5] G. H. Golub and C. Reinsch: 'Singular Value Decomposition and Least Squares Solutions', Numer. Math. 14, pp. 403-420, 1970.
[6] 'SwiftTools DSP Development Software User's Guide', Pentek, Inc. 55 Walnut Street, Norwood, NJ 07648, 1995.
[7] 'SwiftNet Host Software User's Guide', Pentek, Inc. 55 Walnut Street, Norwood, NJ 07648, 1995.
[8] 'Matlab User's Guide', The MathWorks, Inc. 24 Prime Park Way, Natick, Mass. 01760-1500, 1994.
[9] G. F. Franklin: 'Feedback Control of Dynamic Systems', Addison-Wesley Pub. Co., 1994.
[10] J. G. Proakis and D. G. Manolakis: 'Digital Signal Processing', Prentice Hall, 1996.