Flux jumping

From MCEWiki

The DAC range for sq1 feedback typically amounts to slightly more than 2 periods of the sq1 v-phi curve. In some cases, such as extended observations or IV curve acquisition, a much larger dynamic range is desired. The flux jumping feature uses a pre-programmed value of the v-phi period to bring out-of-range computed sq1 feedback values back into the DAC range.

Requirements

1) The DAC range of the sq1 feedback should span at least 1.2 periods of the sq1 v-phi curve.

2) The periods of the sq1 v-phi curves must be known, on a column-by-column basis, in sq1 fb DAC units.


Side-effects

The parameter "rc2 fb_dly" determines the clock cycle in a row visit at which the sq1 feedback is applied. When flux jumping is not enabled, the minimum value for this parameter is 7. When flux jumping is enabled, the additional calculations push the minimum fb_dly to 3+7=10 as of RC firmware 5.1.d. (previsously 11+7=18).

If fb_dly is set to a value smaller than the minimum, the minimum will be used.

Implementation

Each sq1 feedback is managed separately. The implementation is as follows:

1) For each sq1 feedback, we define

  • x : the sq1 feedback, calculated by the PID servo loop at each servo step
  • j : the flux jump counter, read and updated at each servo step
  • y : the value applied to the sq1 feedback DAC, calculated at each step
  • q : the flux quantum in sq1 fb DAC units, pre-programmed by the user.

2) When the sq1 feedback x is calculated, the value applied to the DAC is

y = x - j*q

3) The sq1 fb value is signed and the DAC has a range of -8192 to +8191. If the value applied to the DAC is greater than 0.95 of full positive scale (if y > 7800) then q is incremented by 1. If the value applied to the DAC drops below 0.95 of full negative scale (if y < -7800) then j is decremented by 1.

The effective sq1 DAC range is reduced, with the boundaries used as an overrun area. Having somewhat more than 1.1 V-phi periods in the DAC range prevents rapid flux-jumping back and forth when signals drift near to a +/- 7800 boundary, and reduces potential noise due to inaccurate flux quantum measurements.

4) The flux jump counter, j, is signed and has a range of -128 to +127.

5) When flux-jump counter hits +127/-128, the DAC is set to +8191/-8192. The reported sq1-fb value, however, is still calculated based on the error signal read and is not aware of the flux-jumped value being clamped.

Preparation

Before enabling flux jumping, it is necessary to load the flx_quanta registers with values appropriate for your setup. Good measurements of the flux quanta are extremely valuable here. IDL scripts are available for measuring these quickly and reliably from existing ramp_sq1_fb script output (contact UBC to have that script merged into your branch).

The flux quantum measurements should be transcribed into the experiment.cfg configuration file; they will be written to the MCE the next time the config script is compiled and run (such as on the next auto-tuning). The relevant parameter is:

### Each entry of flux_quanta_rc# is repeated 41 times and written to
### 'rc# flx_quanta%'; a full flx_quanta array can be implemented if
### needed.

flux_quanta = [ 7720, 7720, 7720, 7680, 7680, 7660, 7680, 7700,
                7680, 7720, 7720, 7760, 7740, 7680, 7740, 7720,
                7720, 7700, 7680, 7680, 7720, 7660, 7680, 7680,
                7720, 7640, 7660, 7720, 7660, 7760, 7720, 7660 ];

Currently the config system accepts a single flux quantum for each column, and applies it to all rows. The MCE supports having separate flux quanta for each detector channel, and that functionality can be enabled for users, if desired.

After modifying the flux quanta in experiment.cfg, you can write the values to the MCE by running "mce_make_config" followed by the $MAS_DATA/config_mce_auto_setup_* .

MCE commands

The flux quanta values are exposed as 8 registers on each readout card, corresponding to the 8 columns controlled by that card. Each register accepts 41 values, corresponding to the 41 rows for that column. For columns 8-15, for example, the registers are:

rc2 flx_quanta0
rc2 flx_quanta1
rc2 flx_quanta2
rc2 flx_quanta3
rc2 flx_quanta4
rc2 flx_quanta5
rc2 flx_quanta6
rc2 flx_quanta7

The register en_fb_jump on each readout card controls whether flux jumping is enabled. To enable flux jumping for all readout cards, use the shorthand

wb rca en_fb_jump 1

To disable flux jumping, issue

wb rca en_fb_jump 0

The en_fb_jump register can be read back to determine whether flux jumping is enabled.

Readout

Data modes that report "feedback" or "filtered feedback" will report the full, computed feedback (i.e. y) or filtered feedback signal; they do not report the DAC value applied. In modes that also report the flux jump counter (such as 5 and 9), the number reported is the 8 bit signed integer (j) corresponding to the number of flux quanta subtracted from the sq1 fb to obtain the DAC output value.

When both the feedback and jump counter are reported, it is possible to determine the DAC value applied using the equation above. Note however that there may be a delay of 1 frame between a change in the flux jump counter and its appearance in the data stream. (UBC: clarify, is this exactly one internal frame, always, or what?)