automated beamline alignment at elettra xray diffraction...

20
Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004 Automated Automated beamline beamline alignment at alignment at Elettra Elettra Xray Xray Diffraction Diffraction Beamline Beamline BioXHIT BioXHIT Workshop on Automated X Workshop on Automated X - - ray Provision ray Provision Roberto Borghes Roberto Pugliese Experiments Division Software for Measurements Sincrotrone Trieste S.C.p.A.

Upload: others

Post on 26-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

Automated Automated beamlinebeamline alignment at alignment at ElettraElettra XrayXray Diffraction Diffraction BeamlineBeamline

BioXHITBioXHIT Workshop on Automated XWorkshop on Automated X--ray Provisionray Provision

Roberto BorghesRoberto Pugliese

Experiments DivisionSoftware for MeasurementsSincrotrone Trieste S.C.p.A.

Page 2: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

AGENDAAGENDAAGENDA

• The XRD beamline automatic alignment problem

• Applying the Teleo-Reactive Control theory

• Implementation and first results• Future development

Page 3: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

SCENARIOSCENARIO

Slits

57-PolesWiggler

Graphite Filters

Si Crystals Monochromator

Three SectionToroidal Focusing

Mirror

Ion chamber detector

XX--Ray DiffractionRay DiffractionBeamlineBeamline atat ElettraElettra

Page 4: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

The Ion Chamber detectorThe Ion Chamber detector

• Two ionisation chambers separated by a thin Beryllium foil

• DIFFERENCE of Signal1 and Signal2 estimates beam vertical position

• SUM of Signal1 and Signal2 estimates beam flux

• GOAL: maximize SUM & minimize abs( DIFF )

Page 5: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

Why a Feedback?Why a Feedback?

High temperature Si-Mirror deformation

Slow drifts of Storage Ring Electron Orbit

0.5

0.6

0.7

0.8

0.9

1

01:22 01:48 02:14 02:40 03:05 03:31 03:57 04:23 04:48 05:14 05:40 06:06

Detected Beam Flux

Storage Ring Current

Slope = -0.1

Slope = -0.44

Page 6: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

Automatic Beamline Alignment:Automatic Beamline Alignment:problem solving strategyproblem solving strategy

• Split the alignment problem into small sub-problems involving, for example, only one optical element and the associated sensor

• Implement for each sub-problem an alignment module using traditional or soft computing techniques

• Combine the modules using the strategic, behavioural knowledge of the optics expert

OEnSource Exp.Ch.OEn-1OE2OE1S

0S1

S2

Sn-1

Sn

Sn+1

Page 7: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

Applying Intelligent System Concepts to the Applying Intelligent System Concepts to the Automatic Automatic BeamlineBeamline Alignment problemAlignment problem

• Intelligent Systems (IS) incorporate the creative, abstract and adaptive attributes of a human while minimising the undesirable aspects such as unpredictability, inconsistency, fatigue, subjectivity and temporal instability

• Hybrid Intelligent Systems integrate Knowledge Based Systems, Neural Network, Fuzzy Systems, Evolutionary Algorithms, Case-Based reasoning, Chaos Theory and traditional techniques to solve effectively complex real world problems.

Page 8: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

TeleoTeleo--Reactive (TR) controlReactive (TR) control

• TR control occupies a region between feedbackcontrol and discrete action planning:– actions can be either discrete or continuous– actions are not guaranteed to achieve their goals – actions can be interrupted in response to changes in the

environment

• TR plans can be represented as a sequence of condition-action pairs called TR operators.– TR plan execution is adaptive and opportunistic:

conditions are evaluated from top to bottom and theaction associated o the first true condition is performed.

C0 A0

C1 A1

Cn An

Ci Ai

Page 9: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

TR control planTR control plan

Everything OK? Do nothing

Conditions Actions

Beamdown ? Stop everything

Flux OptimizationNeeded?

Start/Stop FluxOptimizer

Flux Feedback Needed ?

Start/Stop background Flux Feedback

Beam CenteringNeeded ?

Start/Stop background Position Feedback

Prio

r ity

Page 10: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

0

0.5

1

1.5

2

2.5

3

3.5

4.05 4.25 4.45 4.65 4.85 5.05 5.25 5.45

Mirror Motor Position

The actions: OffThe actions: Off--line Flux Optimizerline Flux Optimizer

Measured Beam Flux

COARSE LARGE

INIT

FINEMEDIUM

EXIT

+

_

bad

bad

bad

bad

_

__

+

++

- stepFWD( )- stepREV( )- initLARGE( )- restore( )

50 motor steps

1º - COARSE STEP search till negative slope

5 motor steps

2º - MEDIUM STEP search till negative slope3º - FINE STEP search till negative slope

1 motor step

Max

Page 11: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

The actions: Position FeedbackThe actions: Position Feedback

Toroidal Mirror

ION chamber detector

Correction Algorithm

Stepper Actuator

Photon beamExperimental

Station

Signal DIFF

Toroidal mirror

ION chamber• Background Continuous feedback minimize abs(DIFF)

• Correction Algorithm is not enabled if DIFF < threshold

• Backlash recovery procedure for Stepper Actuator

• Not a fast feedback (period = 2 sec)

Page 12: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

Si-Crystal mirror

ION chamber

The actions: Flux FeedbackThe actions: Flux FeedbackSi-Crystals

MonochromatorION chamber

detector

Linear Regression Algorithm

PiezoActuator

Photon beamExperimental

Station

Signal SUM

• Background Continuous feedback

• Linear Regression Algorithm calculates sign and gain of the correction signal

• Buffer size for LR: 5 samples

•Piezo Actuator avoids backlash problems

• Not a fast feedback (period = 1 sec)

Monochromatorsecond crystal

alignment system

Piezo actuator

microstepper

Page 13: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

Applying the Model Reference Applying the Model Reference architecture to architecture to beamlinebeamline

Beamline

Automatic Beamline Alignment

Sensors Actuators

Beamline Control System

Incr

easi

ng In

telli

genc

e

Incr

easi

ng P

reci

sion

Teleo Reactive Controller

Elettra XCS

ION chamber detector Toroidal mirror

and Si-Crystal

Page 14: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

XCS XCS : : ElettraElettra beamlinebeamline control systemcontrol system

XCScore

VACOmodule

VRZmodule

tcpsmbs_srhttpd

GALILmodule

GEF2008module

DBconfigureinstead of

programmingLog

archive event

corbatangoepics

Page 15: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

XCS python librariesXCS python libraries• pyXCS: Very easy access to XCS• pyFSM: Finite State Machine library• pyTRC: Teleo Reactive Control library

# very small sample of use of XCS class

from pyXCS import *

x = XCS()x.open('bcs102.elettra.trieste.it')a = x.get('frontend_machine_machine_1_accucurr')print 'Accumulated current =', a[0], a[1]x.close()

Page 16: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

XRD Control PanelXRD Control Panel

AutomaticBeamlineAlignment

Control

BeamlineValves Control

Tool Launcher

Manual FluxOptimizer

MonochromatorControl

Page 17: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

First ResultsFirst Results

0.5

0.6

0.7

0.8

0.9

1

01:22 01:48 02:14 02:40 03:05 03:31 03:57 04:23 04:48 05:14 05:40 06:06

Detected Beam Flux

Storage Ring Current

0.85

0.87

0.89

0.91

0.93

0.95

0.97

0.99

1.01

1.03

14:59

:3615

:00:37

15:01

:3915

:02:40

15:03

:4215

:04:44

15:05

:4515

:06:46

15:07

:4815

:08:48

15:09

:5015

:10:51

15:11

:5215

:12:55

15:13

:5615

:14:57

15:15

:5815

:17:00

15:18

:0215

:19:03

15:20

:0515

:21:07

15:22

:0815

:23:10

15:24

:1315

:25:15

15:26

:1615

:27:18

15:28

:19

Detected Beam Flux

Storage Ring Current

WITHOUT Automatic Alignment

WITHAutomatic Alignment

Page 18: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

First ResultsFirst Results

0.85

0.87

0.89

0.91

0.93

0.95

0.97

0.99

1.01

1.03

1.05

10:0

7:08

10:0

8:40

10:1

0:12

10:1

1:44

10:1

3:17

10:1

4:49

10:1

6:22

10:1

7:53

10:1

9:26

10:2

0:59

10:2

2:31

10:2

4:04

10:2

5:36

10:2

7:08

10:2

8:40

10:3

0:12

10:3

1:44

10:3

3:17

10:3

4:51

10:3

6:23

10:3

7:55

10:3

9:26

10:4

0:58

10:4

2:30

10:4

4:02

10:4

5:35

10:4

7:07

10:4

8:39

10:5

0:12

10:5

1:45

10:5

3:18

10:5

4:49

10:5

6:21

Detected Beam Flux

Storage Ring Current

0.98

0.99

1

1.01

1.02

1.03

1.04

17:54

:2917

:57:03

17:59

:3618

:02:11

18:04

:4518

:07:19

18:09

:5218

:12:26

18:14

:5918

:17:33

18:20

:0618

:22:39

18:25

:1318

:27:47

18:30

:2118

:32:55

18:35

:3018

:38:03

18:40

:3718

:43:10

18:45

:4418

:48:17

18:50

:5018

:53:24

18:55

:5718

:58:31

19:01

:0519

:03:38

19:06

:1219

:08:45

Detected Beam Flux

Storage RingCurrent

Automatic Alignment“ramping”

Non Linearity due to mirror deformation

Page 19: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

Future DevelopmentsFuture Developments

• Refactoring of the software libraries in order to be BIOXHIT ready

• Integration with BLU-ICE• Towards the one button beamline and

EVC integration• Integration of MarrResearch Cryogenic

Sample Changer ?!?

Page 20: Automated beamline alignment at Elettra Xray Diffraction ...ftp.esrf.eu/scisoft/BioXHIT/Workshop_030504/bioxhit_030504_Rober… · Roberto Borghes, Roberto Pugliese BioXHIT Workshop,

Roberto Borghes, Roberto Pugliese BioXHIT Workshop, ESRF 2004

AcknowledgementsAcknowledgements

• Edoardo Busetto, Fulvio Bille’, Kristina Djinovic, Sandy Grulja from ELETTRA

• Doriano Lamba, Alberto Cassetta from CNR