Difference between revisions of "High rate acquisition"
(→Scripting support) |
|||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | This document discusses the acquisition of multiplexed data at rates up to ~20 kHz. This is different from 50 MHz [[ Raw-mode readout ]]. | + | This document discusses the acquisition of multiplexed data at rates up to ~20 kHz. This is different from 50 MHz [[Raw-mode readout]]. |
= Timing parameters = | = Timing parameters = | ||
− | The frequency of internal MCE frames, i.e. the multiplexing rate, is determined by the parameters | + | The frequency of internal MCE frames, i.e. the multiplexing rate, is determined by the parameters {{param|sys|num_rows}} and {{param|sys|row_len}}. The MCE switches rows at a rate of 50 MHz / <tt>row_len</tt>, so the effective sampling rate for a given row is |
− | + | ''f''<sub>ARZ</sub> = 50 MHz / ({{param|sys|num_rows}} * {{param|sys|row_len}}) | |
− | The parameters | + | The parameters {{param|sys|num_rows}} and {{param|sys|row_len}} are present on all MCE hardware cards. When writing these parameters, write to the "sys" card, e.g. "wb sys num_rows 8" (this ensures that all cards are updated with the new value). When reading the value it is ok to just use the clock card value, i.e. "rb cc num_rows". |
− | The parameter | + | The parameter {{param|cc|data_rate}} determines how often an internal data frame is sent to the readout PC and written to disk. This parameter is an integer indicating how many internal frames to process before outputting a frame to the PC. The output frame rate is thus |
− | + | ''f''<sub>DV</sub> = ''f''<sub>ARZ</sub> / {{param|cc|data_rate}} | |
= Readout parameters = | = Readout parameters = | ||
Line 14: | Line 14: | ||
Regardless of how many rows are being multiplexed, it is possible to configure a different set of rows to be output. The advantage of this is that by sending less data to the readout PC, the readout frame rate can be increased. | Regardless of how many rows are being multiplexed, it is possible to configure a different set of rows to be output. The advantage of this is that by sending less data to the readout PC, the readout frame rate can be increased. | ||
− | The parameters that determine the form of the output data are | + | The parameters that determine the form of the output data are {{param|cc|num_rows_reported}} and {{param|rc|readout_row_index}}. The {{param|cc|num_rows_reported]} parameter, which lives on the clock card, determines the number of rows of data which should be returned to the readout PC. The {{param|rc|readout_row_index}} parameter, which lives on each readout card, determines the row offset into the frame data at which readout should begin. |
− | For example, to return frames containing only data from row 5, one could set | + | For example, to return frames containing only data from row 5, one could set: |
+ | wb cc {{param|cc|num_rows_reported}} 1 | ||
+ | wb rca {{param|rc|readout_row_index}} 5 | ||
+ | |||
+ | In normal configuration, {{param|cc|num_rows_reported}} should be equal to {{param|sys|num_rows}} and {{param|rc|readout_row_index}} should be equal to 0. | ||
= Throughput limitations = | = Throughput limitations = | ||
− | + | In the large frame-size limit, data transfer rate is limited by MCE internal rates. In pre v5 firmware, this rate works out to approximately 6 MB/s. In v5 and beyond the internal bandwidth has doubled and the limitation is roughly 12 MB/s. | |
− | + | However, for very fast acquisitions we reduce the frame-size and are limited instead by overheads, primarily in the PCI card. In PCI firmware version U1.04, this limits the readout rate to approximately 20 kHz, even for single row readout. In PCI firmware U1.05, this improves to 27 kHz (single row) or 31 kHz (single pixel, preliminary v5 firmware only). | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | Planned firmware overcomes the overhead limitations by packing fast data into full-size frames. This will yield effective single pixel readout rates beyond 800 kHz. | ||
= Scripting support = | = Scripting support = | ||
Line 40: | Line 38: | ||
Example: report 2 rows of every 4th 15.15 kHz frame for about 1 second. | Example: report 2 rows of every 4th 15.15 kHz frame for about 1 second. | ||
− | mce_fast_acq | + | mce_fast_acq 3800 1 4 2 |
The data_rate and rows_reported parameters are optional; check your system for the default values. The readout_row_index parameter must be issued separately (this should be corrected). | The data_rate and rows_reported parameters are optional; check your system for the default values. The readout_row_index parameter must be issued separately (this should be corrected). | ||
+ | |||
+ | To plot the data (of data packets with 1x1 pixels): | ||
+ | mce@mce-ubc-1:/data/cryo/current_data$ python | ||
+ | >>> from pylab import * | ||
+ | >>> from numpy import * | ||
+ | >>> from mce_data import * | ||
+ | >>> data=MCEFile('fast_1275440710').Read() | ||
+ | >>> data.data.shape | ||
+ | >>> plot(data.data[0,0:8000]) | ||
+ | >>> show() | ||
= Failure Recovery = | = Failure Recovery = | ||
Line 50: | Line 58: | ||
dsp_reset | dsp_reset | ||
fakestop | fakestop | ||
+ | |||
+ | [[Category:Clock Card Firmware]] | ||
+ | [[Category:Readout Card Firmware]] | ||
+ | [[Category:MCE Script]] |
Latest revision as of 18:35, 31 August 2016
This document discusses the acquisition of multiplexed data at rates up to ~20 kHz. This is different from 50 MHz Raw-mode readout.
Contents
Timing parameters
The frequency of internal MCE frames, i.e. the multiplexing rate, is determined by the parameters num_rows and row_len. The MCE switches rows at a rate of 50 MHz / row_len, so the effective sampling rate for a given row is
fARZ = 50 MHz / (num_rows * row_len)
The parameters num_rows and row_len are present on all MCE hardware cards. When writing these parameters, write to the "sys" card, e.g. "wb sys num_rows 8" (this ensures that all cards are updated with the new value). When reading the value it is ok to just use the clock card value, i.e. "rb cc num_rows".
The parameter data_rate determines how often an internal data frame is sent to the readout PC and written to disk. This parameter is an integer indicating how many internal frames to process before outputting a frame to the PC. The output frame rate is thus
fDV = fARZ / data_rate
Readout parameters
Regardless of how many rows are being multiplexed, it is possible to configure a different set of rows to be output. The advantage of this is that by sending less data to the readout PC, the readout frame rate can be increased.
The parameters that determine the form of the output data are num_rows_reported and readout_row_index. The {{param|cc|num_rows_reported]} parameter, which lives on the clock card, determines the number of rows of data which should be returned to the readout PC. The readout_row_index parameter, which lives on each readout card, determines the row offset into the frame data at which readout should begin.
For example, to return frames containing only data from row 5, one could set:
wb cc num_rows_reported 1 wb rca readout_row_index 5
In normal configuration, num_rows_reported should be equal to num_rows and readout_row_index should be equal to 0.
Throughput limitations
In the large frame-size limit, data transfer rate is limited by MCE internal rates. In pre v5 firmware, this rate works out to approximately 6 MB/s. In v5 and beyond the internal bandwidth has doubled and the limitation is roughly 12 MB/s.
However, for very fast acquisitions we reduce the frame-size and are limited instead by overheads, primarily in the PCI card. In PCI firmware version U1.04, this limits the readout rate to approximately 20 kHz, even for single row readout. In PCI firmware U1.05, this improves to 27 kHz (single row) or 31 kHz (single pixel, preliminary v5 firmware only).
Planned firmware overcomes the overhead limitations by packing fast data into full-size frames. This will yield effective single pixel readout rates beyond 800 kHz.
Scripting support
The MAS script mce_fast_acq is provided to perform fast acquisition and then return the system to its previous state. The assumption of the script is that the user would like to do high rate readout on a system whose timing parameters have already been configured.
Script usage is (r179):
mce_fast_acq n_frames rc [ data_rate [ rows_reported ] ]
Example: report 2 rows of every 4th 15.15 kHz frame for about 1 second.
mce_fast_acq 3800 1 4 2
The data_rate and rows_reported parameters are optional; check your system for the default values. The readout_row_index parameter must be issued separately (this should be corrected).
To plot the data (of data packets with 1x1 pixels):
mce@mce-ubc-1:/data/cryo/current_data$ python >>> from pylab import * >>> from numpy import * >>> from mce_data import * >>> data=MCEFile('fast_1275440710').Read() >>> data.data.shape >>> plot(data.data[0,0:8000]) >>> show()
Failure Recovery
Too-fast acquisition (not yet supported...) may result in the confusion of MAS/MCE. The typical symptom is that the fast acquisition does not exit in a timely manner. The best way to fix this is to open 'mce_cmd -i' (in a separate window) and issue the following commands:
mce_reset dsp_reset fakestop