Difference between revisions of "Data mode"

From MCEWiki
(Data Modes and Windowing)
(Data Modes and Windowing)
Line 20: Line 20:
  
 
= Data Modes and Windowing =
 
= Data Modes and Windowing =
* Current as of Readout Card firmware revision 4.0.c)
 
 
* The data modes below offer the types of data listed above in various combinations, and with different windowings.  Each data point in a data packet is 32 bits wide, and may have several types of data packed into it.  The table below specifies the different packings.
 
* The data modes below offer the types of data listed above in various combinations, and with different windowings.  Each data point in a data packet is 32 bits wide, and may have several types of data packed into it.  The table below specifies the different packings.
 
* The table below makes liberal use of variables '''sq1_fb, error, sq1_fb_filtered, num_flux_jumps,''' and '''raw_data''', which are defined above.   
 
* The table below makes liberal use of variables '''sq1_fb, error, sq1_fb_filtered, num_flux_jumps,''' and '''raw_data''', which are defined above.   
Line 34: Line 33:
 
|| Error  
 
|| Error  
 
|| 32b (signed) co-added Error signal err[31:0]. <br />
 
|| 32b (signed) co-added Error signal err[31:0]. <br />
<br />
+
* [31:0] = error  
Break-down by bit-field:
 
* [31:0] '''error_mode0''' = error  
 
  
 
|| all
 
|| all
Line 44: Line 41:
 
||'''When servo_mode = 3:'''
 
||'''When servo_mode = 3:'''
 
32b (signed) SQ1 Feedback data fb[31:0]. <br />
 
32b (signed) SQ1 Feedback data fb[31:0]. <br />
<br />
+
* [31:0] = sq1_fb * 2<sup>12</sup>
Break-down by bit-field:
 
* [31:0] '''feedback_mode1a''' = sq1_fb * 2<sup>12</sup>
 
 
 
Because servo_mode=3 is the normal running condition, only feedback_mode1a is supported by most MAS programs.  The non-servoing form, feedback_mode1b, is included here for completeness.
 
 
 
 
'''When servo_mode != 3:''' <br />
 
'''When servo_mode != 3:''' <br />
<br />
 
 
32b (signed) SQ1 Feedback from the rc? fb_const registers. These are DAC values. <br />
 
32b (signed) SQ1 Feedback from the rc? fb_const registers. These are DAC values. <br />
<br />
+
* [31:0] = sq1_fb
Break-down by bit-field:
+
 
* [31:0] '''feedback_mode1b''' = sq1_fb
+
''Note that servo_mode=3 is the normal running condition. The non-servoing form, used at times during array-auto-tune for example, is included here for completeness.
+
''  
 
|| all
 
|| all
 
|-
 
|-
Line 62: Line 53:
 
|| Filtered feedback  
 
|| Filtered feedback  
 
||32b (signed) low-pass filtered SQ1 feedback data fb[31:0].  <br />
 
||32b (signed) low-pass filtered SQ1 feedback data fb[31:0].  <br />
<br />
+
* [31:0] = sq1_fb_filtered
Break-down by bit-field:
 
* [31:0] '''filtered_fb_mode2''' = sq1_fb_filtered
 
  
 
|| 2.0.5 and later
 
|| 2.0.5 and later
 
|-
 
|-
| 3  
+
| 3 obsolete <br /> (see 12)
 
|| Raw 50 MHz  
 
|| Raw 50 MHz  
 
|| Raw 50 MHz ADC samples raw[13:i], where i=0 in rev. 4.3.7 and i=6 in all previous firmware. <br />
 
|| Raw 50 MHz ADC samples raw[13:i], where i=0 in rev. 4.3.7 and i=6 in all previous firmware. <br />
<br />
+
* [31:0] = raw_data / (2<sup>i</sup>),
Break-down by bit-field:
 
* [31:0] '''raw_mode3''' = raw_data / (2<sup>i</sup>),
 
 
 
  
 
|| Only 3.0.6, 3.0.16, 3.0.25, 4.1.7, 4.2.7, 4.3.7
 
|| Only 3.0.6, 3.0.16, 3.0.25, 4.1.7, 4.2.7, 4.3.7
Line 81: Line 67:
 
|| 18:14 Mixed  
 
|| 18:14 Mixed  
 
||Signed 18b SQ1 feedback fb[31] & fb[28:12] + signed 14b coadded error signal err[31] & err[12:0].  <br />
 
||Signed 18b SQ1 feedback fb[31] & fb[28:12] + signed 14b coadded error signal err[31] & err[12:0].  <br />
<br />
+
* [31:14] = sq1_fb  
Break-down by bit-field:
+
* [13:0] = error
* [31:14] '''feedback_mode4''' = sq1_fb  
 
* [13:0] '''error_mode4''' = error
 
  
 
|| 2.0.9 and later
 
|| 2.0.9 and later
Line 91: Line 75:
 
|| 24:8 mixed  
 
|| 24:8 mixed  
 
|| Signed 24b SQ1 feedback fb[31:8] + signed 8b num_flux_jumps fj[7:0]. <br />
 
|| Signed 24b SQ1 feedback fb[31:8] + signed 8b num_flux_jumps fj[7:0]. <br />
<br />
+
* [31:8] = sq1_fb * 2<sup>4</sup>
Break-down by bit-field:
+
* [7:0] = num_flux_jumps
* [31:8] '''feedback_mode5''' = sq1_fb * 2<sup>4</sup>
 
* [7:0] '''num_flux_jumps_mode5''' = num_flux_jumps
 
  
 
|| all
 
|| all
Line 101: Line 83:
 
|| 18:14 mixed
 
|| 18:14 mixed
 
|| Signed 18b filtered data filter[31] & filter[27:11] + signed 14b coadded error signal err[31] & err[12:0]. <br />
 
|| Signed 18b filtered data filter[31] & filter[27:11] + signed 14b coadded error signal err[31] & err[12:0]. <br />
<br />
+
* [31:13] = sq1_fb_filtered / (2<sup>11</sup>)
Break-down by bit-field:
+
* [12:0] = error
* [31:13] '''filtered_fb_mode6''' = sq1_fb_filtered / (2<sup>11</sup>)
 
* [12:0] '''error_mode6''' = error
 
  
 
|| 3.0.30 to 4.0.6 only
 
|| 3.0.30 to 4.0.6 only
Line 111: Line 91:
 
|| 22:10 mixed
 
|| 22:10 mixed
 
|| Signed 22b filtered data filter[31] & filter[27:7] + signed 10b coadded error signal err[31] & err[12:4]. <br />
 
|| Signed 22b filtered data filter[31] & filter[27:7] + signed 10b coadded error signal err[31] & err[12:4]. <br />
<br />
+
* [31:10] = sq1_fb_filtered / (2<sup>7</sup>)
Break-down by bit-field:
+
* [9:0]   = error / (2<sup>4</sup>)
* [31:10] '''filtered_fb_mode7''' = sq1_fb_filtered / (2<sup>7</sup>)
 
* [9:0] '''error_mode7''' = error / (2<sup>4</sup>)
 
  
 
|| 4.0.2 and later
 
|| 4.0.2 and later
Line 121: Line 99:
 
||24:8 mixed  
 
||24:8 mixed  
 
|| Signed 24b filtered data filter[31:8] + signed 8b num_flux_jumps fj[7:0]. <br />
 
|| Signed 24b filtered data filter[31:8] + signed 8b num_flux_jumps fj[7:0]. <br />
<br />
+
* [31:8] = sq1_fb_filtered / (2<sup>8</sup>)
Break-down by bit-field:
+
* [7:0] = num_flux_jumps
* [31:8] '''filtered_fb_mode8''' = sq1_fb_filtered / (2<sup>8</sup>)
 
* [7:0] '''num_flux_jumps_mode8''' = num_flux_jumps
 
  
 
|| 4.0.4 only
 
|| 4.0.4 only
Line 131: Line 107:
 
|| 24:8 mixed  
 
|| 24:8 mixed  
 
|| Signed 24b filtered data filter[31] & filter[23:1] + signed 8b num_flux_jumps fj[7:0]. <br />
 
|| Signed 24b filtered data filter[31] & filter[23:1] + signed 8b num_flux_jumps fj[7:0]. <br />
<br />
+
* [31:8] = sq1_fb_filtered/ (2<sup>1</sup>)
Break-down by bit-field:
+
* [7:0] = num_flux_jumps  
* [31:8] '''filtered_fb_mode9''' = sq1_fb_filtered/ (2<sup>1</sup>)
 
* [7:0] '''num_flux_jumps_mode9''' = num_flux_jumps  
 
  
 
|| 4.0.5 and later
 
|| 4.0.5 and later
Line 141: Line 115:
 
|| 25:7 mixed  
 
|| 25:7 mixed  
 
|| Signed 25b filtered data filter[27:3] + signed 7b num_flux_jumps fj[6:0]. <br />
 
|| Signed 25b filtered data filter[27:3] + signed 7b num_flux_jumps fj[6:0]. <br />
<br />
+
* [31:7] = sq1_fb_filtered / (2<sup>3</sup>)
Break-down by bit-field:
+
* [6:0] = num_flux_jumps
* [31:7] '''filtered_fb_mode10''' = sq1_fb_filtered / (2<sup>3</sup>)
 
* [6:0] '''num_flux_jumps_mode10''' = num_flux_jumps
 
  
 
|| 4.1.6, 4.0.b and later
 
|| 4.1.6, 4.0.b and later
Line 151: Line 123:
 
|| 6:3 mixed, debugging mode  
 
|| 6:3 mixed, debugging mode  
 
|| Unsigned 6b row_index + unsigned 3b column_index. <br />
 
|| Unsigned 6b row_index + unsigned 3b column_index. <br />
<br />
 
Break-down by bit-field:
 
 
* [31:10] '''----'''
 
* [31:10] '''----'''
 
* [9:3] '''row_index'''
 
* [9:3] '''row_index'''
Line 160: Line 130:
 
|-
 
|-
 
| 12  
 
| 12  
|| Raw 50 MHz Data
+
|| Raw 50 MHz
 
|| Raw 50 MHz ADC samples raw[13:0], sign-extended to 32 bits.
 
|| Raw 50 MHz ADC samples raw[13:0], sign-extended to 32 bits.
<br />
+
* [31:0] = raw_data
Break-down by bit-field:
 
* [31:0] '''raw_mode12''' = raw_data
 
  
 
|| 4.0.d, 4.0.e, 5.0.1+
 
|| 4.0.d, 4.0.e, 5.0.1+

Revision as of 11:23, 21 October 2009

In MCE-speak, a "data mode" or "data_mode" is a way of encoding MCE signals into binary data. Data modes are readout parameters, and do not affect the way that the MCE servos, multiplexes, biases, or phi0-corrects.

MCE Data Types

There are 5 types of data that the MCE can return in data packets:

  1. sq1_fb: the feedback applied by the MCE to the 1st stage SQUIDs:
    • <math>sq1\_fb_{n+1} = \frac{1}{2^{12}} \left[\left(gainp \times error_{n}\right) + \left(gaini \times \sum_{i=1}^{n} error_i\right) + \left(gaind \times [error_{n} - error_{n-1}]\right) \right]</math>
    • Where <math>\sum_{i=1}^n error_i</math> is the integral of the error from the moment the pixel was locked, and
    • Where <math>\left[error_{n} - error_{n-1} \right]</math> is the difference between the current error value and the previous one.
    • Where 'n' is the frame period index
    • Where 'i' is the frame period index since the PID-loop was locked (servo_mode = 3)
  2. error: the error calculated from the Series-Array signals sampled by the ADCs:
    • <math>error = \sum_{i=1}^{sample\_num} (adc\_reading_{i} - adc\_offset)</math>
  3. sq1_fb_filtered: the low-pass filtered SQ1 feedback (see 4-pole Butterworth low-pass filter ). The effective DC gain, including quantization error, is approximately:
    • <math>sq1\_fb\_filtered_{n} \simeq 1218 \times \left[sq1\_fb_{n-1}\right]</math>
  4. num_flux_jumps: the value stored in the flux-jump counter. See Flux jumping .
    • <math>num\_flux\_jumps_{n} = \frac{1}{flux\_quanta} \left[(sq1\_fb_{n}) - (sq1\_fb\_applied\_to\_DAC_{n})\right] </math>
  5. raw_data: raw data sampled @ 50 MHz. See Raw-mode readout .
    • <math>raw\_data = \left[adc\_reading\right]</math>
    • NOT <math>raw\_data = \left[adc\_reading - adc\_offset\right]</math>

Data Modes and Windowing

  • The data modes below offer the types of data listed above in various combinations, and with different windowings. Each data point in a data packet is 32 bits wide, and may have several types of data packed into it. The table below specifies the different packings.
  • The table below makes liberal use of variables sq1_fb, error, sq1_fb_filtered, num_flux_jumps, and raw_data, which are defined above.
  • Generally, a data packet contains one data point per pixel, although there are exceptions to this:
    • Fast Data: packets contain data for a subset of pixels to allow readout at a faster rate: High rate acquisition .
    • Raw Data: packets contain a 50MHz time stream of data starting from row zero.
Data Mode Summary Pixel-Data Description RC Firmware Revision
0 Error 32b (signed) co-added Error signal err[31:0].
  • [31:0] = error
all
1 Feedback When servo_mode = 3:

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

  • [31:0] = sq1_fb * 212

When servo_mode != 3:
32b (signed) SQ1 Feedback from the rc? fb_const registers. These are DAC values.

  • [31:0] = sq1_fb

Note that servo_mode=3 is the normal running condition. The non-servoing form, used at times during array-auto-tune for example, is included here for completeness.

all
2 Filtered feedback 32b (signed) low-pass filtered SQ1 feedback data fb[31:0].
  • [31:0] = sq1_fb_filtered
2.0.5 and later
3 obsolete
(see 12)
Raw 50 MHz Raw 50 MHz ADC samples raw[13:i], where i=0 in rev. 4.3.7 and i=6 in all previous firmware.
  • [31:0] = raw_data / (2i),
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].
  • [31:14] = sq1_fb
  • [13:0] = 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].
  • [31:8] = sq1_fb * 24
  • [7:0] = num_flux_jumps
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].
  • [31:13] = sq1_fb_filtered / (211)
  • [12:0] = 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].
  • [31:10] = sq1_fb_filtered / (27)
  • [9:0] = error / (24)
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].
  • [31:8] = sq1_fb_filtered / (28)
  • [7:0] = num_flux_jumps
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].
  • [31:8] = sq1_fb_filtered/ (21)
  • [7:0] = num_flux_jumps
4.0.5 and later
10 25:7 mixed Signed 25b filtered data filter[27:3] + signed 7b num_flux_jumps fj[6:0].
  • [31:7] = sq1_fb_filtered / (23)
  • [6:0] = num_flux_jumps
4.1.6, 4.0.b and later
11 6:3 mixed, debugging mode Unsigned 6b row_index + unsigned 3b column_index.
  • [31:10] ----
  • [9:3] row_index
  • [2:0] column_index
5.0.0 and later
12 Raw 50 MHz Raw 50 MHz ADC samples raw[13:0], sign-extended to 32 bits.
  • [31:0] = raw_data
4.0.d, 4.0.e, 5.0.1+

Automatic loading of data with mas_data.pro

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_feedback (DAC) units (i.e. data mode 1 divided by 212)
  • filtered sq1 feedback is rescaled to the units of data mode 2.

This means the IDL user does not need to worry about the windowing of the different data modes for many applications.

Links