Difference between revisions of "Data mode"

From MCEWiki
(PID Loop Calculations)
Line 1: Line 1:
= PID Loop Calculations =
+
= PID Loop Calculation =
  '''feedback''' = [(p_coeff*'''error''')+(i_coeff*integral)+(d_coeff*difference)] / [2<sup>12</sup>]  
+
  '''feedback''' = [(p_coeff*'''error''')+(i_coeff*integral)+(d_coeff*difference)] / [2<sup>12</sup>]
  
 
= Table of Data Modes (Current as of Revision 4.0.c)=
 
= Table of Data Modes (Current as of Revision 4.0.c)=

Revision as of 13:57, 30 September 2008

PID Loop Calculation

feedback = [(p_coeff*error)+(i_coeff*integral)+(d_coeff*difference)] / [212]

Table of Data Modes (Current as of Revision 4.0.c)

Data Mode Summary Pixel-Data Description RC Firmware Revision
0 Error 32b (signed) co-added Error signal err[31:0].

sample_num*(adc_reading – adc_offset)

all
1 Feedback 32b (signed) SQ1 Feedback data fb[31:0].

When servo_mode = 3, the gain of the feedback relative to the value applied to the DAC is 212.

all
2 Filtered feedback 32b (signed) low-pass filtered SQ1 feedback data fb[31:0].

The gain is 1218 relative to mode 1 at DC.

2.0.5 and later
3 Raw 50 MHz Raw 50 MHz ADC samples raw[13:0].

The gain is 1/(26) relative to mode 0, except in rev. 4.3.7 where the gain is unity.

Only 3.0.6, 3.0.16, 3.0.25, 4.1.7, 4.2.7, 4.3.7
4 18:14 Mixed Signed 18b SQ1 feedback fb[31] & fb[28:12] + signed 14b coadded error signal err[31] & err[12:0].

The gain is 1/(212) relative to mode 1 for the feedback.

The gain is unity relative to mode 0 for the error.

2.0.9 and later
5 24:8 mixed Signed 24b SQ1 feedback fb[31:8] + signed 8b num_flux_jumps fj[7:0].

The gain is 1/(28) relative to mode 1

all
6 obsolete 18:14 mixed Signed 18b filtered data filter[31] & filter[27:11] + signed 14b coadded error signal err[31] & err[12:0].

The gain is 1218/(211) relative to mode 1 for the filter.

The gain is 1 relative to mode 0 for the error.

3.0.30 to 4.0.6 only
7 22:10 mixed Signed 22b filtered data filter[31] & filter[27:7] + signed 10b coadded error signal err[31] & err[12:4].

The gain is 1218/(27) relative to mode 1 for the filter

The gain is 1/(24) relative to mode 0 for the error

4.0.2 and later
8 obsolete 24:8 mixed Signed 24b filtered data filter[31:8] + signed 8b num_flux_jumps fj[7:0].

The gain is 1218/(28) relative to mode 1 for the filter

4.0.4 only
9 24:8 mixed Signed 24b filtered data filter[31] & filter[23:1] + signed 8b num_flux_jumps fj[7:0].

The gain is 1218/(21) relative to mode 1 for the filter

4.0.5 and later
10 25:7 mixed Signed 25b filtered data filter[27:3] + signed 7b num_flux_jumps fj[6:0].

The gain is 1218/(23) relative to mode 1 for the filter

4.1.6, 4.0.b and later

Note regarding units

During normal readout (i.e. not raw mode), there are 4 data associated with each channel. These are:

  • co-added error ("error")
  • sq1 feedback ("sq1fb")
  • filtered sq1 feedback ("filtered sq1fb")
  • flux jump counter ("num_flux_jumps")

Depending on the data mode, these values will be windowed in a different way. The notes in the table above explain the windowing, in terms of how many bits are reported and the relative scaling of the windowed value relative to some reference data mode.

The scaling is quoted as being relative to some reference data mode. For example, in data mode 4 the text

"The feedback reported in this mode is divided by 212 compared to data_mode=1."

is meant to imply that if I were to observe the same system's feedback in data_mode 4 and data_mode 1, and call the two measurements fb_4 and fb_1, then I would expect

 fb_4 = fb_1 >> 12 = floor[ fb_1 / 2^12 ]

where >> denotes the right-bit-shift operator.

The reference data modes for error, sq1fb and filtered sq1fb are, respectively, 0, 1, and 2. In these modes, the meaning of the data are as follows:

Signal Reference data mode Description
co-added error 0 Co-added error for the current internal MCE frame. For ADC readings Y, adc_offset Yo and where n is the sample_num, the error e is <math>e = \sum_1^n (Y - Y_0)</math>, where n is sample_num.
SQ1 feedback 1 Calculated squid1 feedback. Note that this number should be distinguished from the sq1_DAC value, which is obtained from bits [25:12] of the SQ1 feedback. When flux-jumping is active, an integer multiple of the flux_quanta value will be subtracted from sq1_DAC prior to application to the DAC.
filtered SQ1 feedback 2 The output from the 4-pole Butterworth low-pass filter . The input to the filter is the SQ1 feedback signal. The effective DC gain, including quantization error, is approximately 1216.


Please note that, by default, mas_data.pro will rescale data in the following way:

  • error signals are rescaled to match the units of data mode 0.
  • sq1 feedback is rescaled to sq1_DAC units (i.e. data mode 1 divided by 212)
  • filtered sq1 feedback is rescaled to the units of data mode 2.