config_moco.md 6.74 KB
Newer Older
Cyril Guilloud's avatar
Cyril Guilloud committed
1
2
3
4
5
# MOCO

## Description


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

The Monochromator Controller (MoCo) is an electronic module designed to regulate
the position of an optical component in a synchrotron radiation beamline. The
controller corrects the position of the component, typically a mirror or a
monochromator, by monitoring the outgoing beam and actively compensating low
frequency drifts due to thermal load changes or mechanical instability.

Features:

* Active regulation of an optical element on one of its degrees of freedom.
* Keeps constant either the transmission or the position of the beam.
* Primarily designed for double crystal monochromators but it could be
  potentially used with other optics (mirrors, single crystal monochromators).
* Main features:- Time constant from 1 ms to 1 minute- Automatic tuning-
  Autorange- Beam lost detection- Current and voltage inputs- Serial line
  communication
* Can be configured from slave mode to fully automatic mode.
* Built-in current amplifiers (24 gain ranges over 7 decades).



BLISS Moco controller provides:
Cyril Guilloud's avatar
Cyril Guilloud committed
28

29
* Raw access to MOCO commands
30
31
* Direct access as method or attributes to the main functionnalities of the
  device
32
33
* Access to MOCO values as BLISS counters
* definition of a BLISS motor to control the Voltage output of the module
Cyril Guilloud's avatar
Cyril Guilloud committed
34
35
36
  (usually a piezo is connected to this output)


37
38
39
40
## References

* BCU wiki page: http://wikiserv.esrf.fr/bliss/index.php/Moco

Cyril Guilloud's avatar
Cyril Guilloud committed
41
42
43
44
45
46
47
48
49
50
51

## Configuration

### YAML configuration file example


```YAML
- plugin: bliss                     (mandatory)
  class: Moco                       (mandatory)
  name: mocoeh1                     (mandatory)
  serial:                           (mandatory)
52
53
    url: rfc2217://ld421-new:28213  (mandatory)

Cyril Guilloud's avatar
Cyril Guilloud committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
  counters:
    - counter_name: outm
      role: outbeam
    - counter_name: inm
      role: inbeam
    - counter_name: summ
      role: sum
    - counter_name: diffm
      role: diff
    - counter_name: ndiffm
      role: ndiff
    - counter_name: ratiom
      role: ratio

    - counter_name: foutm
      role: foutbeam
    - counter_name: finm
      role: finbeam
    - counter_name: fsumm
      role: fsum
    - counter_name: fdiffmcamill
      role: fdiff
    - counter_name: fndiffm
      role: fndiff
    - counter_name: fratiom
      role: fratio
      
    - counter_name: oscmainm
      role: oscmain
    - counter_name: oscquadm
      role: oscquad
      
    - counter_name: piezom
      role: piezo

- plugin: emotion
90
  class: MocoMotorController
Cyril Guilloud's avatar
Cyril Guilloud committed
91
92
93
94
95
96
97
98
99
100
  moco: $mocoeh1
  axes:
    - name: qgth2
      class: NoSettingsAxis
      unit: V
      steps_per_unit: 1.0
```

### Configuration options

101
102
* Motor can be removed from the yml file if not needed.
* In the `counters` section add only the needed counters.
Cyril Guilloud's avatar
Cyril Guilloud committed
103
104


105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338

## Usage

In the following session, The Moco object `moco` is running in the
`moco` BLISS session

### User API

#### status

* Status got from the MOCO device

```python
DEMO [1]: moco
 Out [1]: MOCO
          Name    : moco
          Comm.   : Serial[rfc2217://lid265:28254]

          MOCO 02.00  -  Current settings:
            NAME "no name"
            ADDR

            OPRANGE -2 5 0
            INBEAM SOFT 1
            OUTBEAM VOLT NORM UNIP 1.25 NOAUTO

            MODE OSCILLATION
            AMPLITUDE 0.0513738
            FREQUENCY 166.667
            PHASE 150
            SLOPE 1
            SETPOINT 0
            TAU 0.1
            SET
            CLEAR  AUTORUN BEAMCHECK NORMALISE AUTORANGE INTERLOCK
            AUTOTUNE OFF
            AUTOPEAK OFF
            BEAMCHECK 0.1 0.1 1.024 0
            SRANGE 0 3
            SPEED 2 50
            INHIBIT OFF LOW
```

* Status of the regulation

```python
DEMO [2]: moco.state()
IDLE
```

#### Parameters

A number of MOCO parameters can set and read:

* `amplitude`
```python
DEMO [3]: moco.amplitude = 0.00513
DEMO [4]: moco.amplitude
 Out [4]: 0.00513
```

* `phase`
```python
DEMO [5]: moco.phase = 150.0
DEMO [6]: moco.phase
 Out [6]: 150.0
```

* `slope`
```python
DEMO [7]: moco.slope = 1.0
DEMO [8]: moco.slope
 Out [8]: 1.0
```

* `tau`
```python
DEMO [9]: moco.tau = 0.1
DEMO [10]: moco.tau
 Out [10]: 0.1
```

* `frequency`
```python
DEMO [11]: moco.frequency = 166.667
DEMO [12]: moco.frequency
 Out [12]: 166.667
```

#### Commands

All commands of a MOCO obejct have silent mode:

```python
moco.command(par1=val1, par2=val2, ..., silent=False/True)
```

The most important functionnalities of MOCO may be access using the following
commands:

* `mode`
```python
DEMO [14]: moco.mode("OSCILLATION")
MODE: OSCILLATION       [POSITION | INTENSITY | OSCILLATION]
 Out [14]: 'OSCILLATION'

DEMO [15]: moco.mode()
MODE: OSCILLATION       [POSITION | INTENSITY | OSCILLATION]
 Out [15]: 'OSCILLATION'
```

* `srange`
```python
DEMO [16]: moco.srange(0, 3)
SRANGE: [0 - 3]
 Out [116]: [0.0, 3.0]

DEMO [17]: moco.srange()
SRANGE: [0 - 3]
 Out [17]: [0.0, 3.0]
```

* `outbeam`
```python
DEMO [18]: moco.outbeam("VOLT", "NORM", "UNIP", 1.25, "autoscale")
OUTBEAM: source    : VOLT       [CURR | VOLT | EXT]
         polarity  : NORM       [NORM | INV]
         channel   : UNIP       [BIP | UNI]
         fullscale : 1.25
         autoscale : NOAUTO     [AUTO | NOAUTO]
DEMO [19]: moco.outbeam()
OUTBEAM: source    : VOLT       [CURR | VOLT | EXT]
         polarity  : NORM       [NORM | INV]
         channel   : UNIP       [BIP | UNI]
         fullscale : 1.25
         autoscale : NOAUTO     [AUTO | NOAUTO]
```

* `go`
```python
DEMO [20]: moco.go()
```

* `peak`
```python
DEMO [21]: moco.peak(1, 0.1, 0.0)
DEMO [22]: moco.peak()
PEAK: height=1  width=0.1  pos=0
 Out [22]: [1.0, 0.1, 0.0]
```

* `tune`
```python
DEMO [20]: moco.tune()
```

* `stop`
```python
DEMO [20]: moco.stop()
```

* `beam`
```python
DEMO [19]: moco.beam()

Beam IN  [0]
Beam OUT [0.0223569]
```

### Raw commands

* MOCO commands may be call using raw communication system

```python
DEMO [3]: moco.comm("?BEAM")
 Out [3]: '0 0.0217459'
```

* List of commands available using the .comm method

```python
DEMO [2]: moco.help()

      RESET
        GO
      STOP
      TUNE
  AUTOTUNE  ?AUTOTUNE
  AUTOPEAK  ?AUTOPEAK
     PIEZO  ?PIEZO
            ?STATE
            ?BEAM
            ?FBEAM
  AUTOBEAM
  SOFTBEAM  ?SOFTBEAM
   OPRANGE  ?OPRANGE
    SRANGE  ?SRANGE
       SET
            ?CLEAR
     CLEAR
            ?SET
     PAUSE  ?PAUSE
   INHIBIT  ?INHIBIT
       TAU  ?TAU
  SETPOINT  ?SETPOINT
      MODE  ?MODE
    INBEAM  ?INBEAM
   OUTBEAM  ?OUTBEAM
      GAIN  ?GAIN
      ZERO  ?ZERO
    OFFSET  ?OFFSET
  ADCCALIB  ?ADCCALIB
 BEAMCHECK  ?BEAMCHECK
     SPEED  ?SPEED
      PEAK  ?PEAK
     SLOPE  ?SLOPE
            ?OSCBEAM
            ?OSCSAT
     OSCIL  ?OSCIL
 AMPLITUDE  ?AMPLITUDE
 FREQUENCY  ?FREQUENCY
     PHASE  ?PHASE
            ?INFO
   ISGTEST  ?ISGTEST
      ECHO
    NOECHO
            ?ERR
      ADDR  ?ADDR
            ?CHAIN
      NAME  ?NAME
            ?VER
            ?HELP
```