Difference between revisions of "Ramp Generator"

From MCEWiki
Line 9: Line 9:
  
 
If you are writing your own script, the following MCE parameters need to be set:  
 
If you are writing your own script, the following MCE parameters need to be set:  
* '''internal_cmd_mode''', '''ramp_step_period''', '''ramp_param_id''', '''ramp_card_addr''',''' ramp_step_data_num''', '''ramp_min_val''', '''ramp_max_val''', '''ramp_step_size'''.  
+
* '''internal_cmd_mode''', '''ramp_step_period''', '''ramp_param_id''', '''ramp_card_addr''',''' ramp_step_data_num''', '''ramp_min_val''', '''ramp_max_val''', '''ramp_step_size''', '''ramp_step_phase'''(optional).
  
 
Refer to [http://www.phas.ubc.ca/~mce/mcedocs/software/SC2_ELE_S580_515_mce_command_description.pdf MCE Command Description] for details.
 
Refer to [http://www.phas.ubc.ca/~mce/mcedocs/software/SC2_ELE_S580_515_mce_command_description.pdf MCE Command Description] for details.
Line 44: Line 44:
 
From this dump we see that the "tes bias" virtual parameter is mapped, in this MCE, to the bias card "bias" parameters.  We then note that "bc1 bias" corresponds to parameter id 0x21 and card id 0x07.
 
From this dump we see that the "tes bias" virtual parameter is mapped, in this MCE, to the bias card "bias" parameters.  We then note that "bc1 bias" corresponds to parameter id 0x21 and card id 0x07.
  
== Ramp Timing and Use Cases ==
+
== Timing of Internal Commands ==
The internal ramp generator can be used to start a square wave on the TES bias line for example. Then when taking data in rectangle mode, multiple RC samples are fit into each readout-frame with the effective ramp_value recorded in the data header.
+
See [[MCE_Timing_Diagram#Timing_of_Internal_commands]]
 
 
Assume: num_rows=2, num_rows_reported=2, data_rate=128, row_len=100, step_period=256, ramp on flux_fb of BC1 from 0xB to 0xF. The rough timing of the operation is at follows:
 
Clock Card schedules 2 commands to be issued over the backplane:
 
- a return-data command to RC1
 
- a bias step command to BC1
 
 
 
Clock Card waits for a command to be completed and for reply to come back before issuing the next command. How long it takes for a reply to come back depends on the data frame size and hence the reply size.
 
 
 
So here is the sequence of actions of the digital pipeline:
 
- a return-data command is issued to RC1 at ARZ (address-return-to-zero)
 
- RC1 returns data from previous ARZ frame with bias_step_value in effect in that frame.
 
- bias value is incremented.
 
- a bias-step command is issued over the backplane if there is one scheduled (depends on step_period).
 
- the command is processed by bias card and the bias serial DAC is updated (16 x 25MHz clock cycles)
 
 
 
All this comes down to a delay of ~< 30us.
 
 
 
The ramp period is determinded with the parameter step_period. '''Best practice is to set it to be multiples of the data_rate'''.
 
 
 
Here is a timing snapshot of the simulation results for 2 rows:
 
 
 
[[File:internal_ramp_data_num_rows2.jpg]]
 
 
 
and here is for 8 rows:
 
 
 
[[File:internal_ramp_data_num_rows8.jpg]]
 

Revision as of 15:38, 18 May 2012

  • The MCE can be set to write values to internal registers. For arbitrary shapes, see Arbitrary Waveform Generator .
  • Setup for simple ramps is similar to the setup for arbitrary waveforms.
  • The ramp operates between a minimum and maximum value, with some step value. Once the maximum value is passed, the ramp will reset to the minimum value and repeat.
  • The ramp can only operate on a single MCE register at a time. This means that parameters that are spread over multiple cards can not be ramped simultaneously.

For script-level support: see mce_internal_ramp.

Low-Level MCE Parameters for internal Ramp

If you are writing your own script, the following MCE parameters need to be set:

  • internal_cmd_mode, ramp_step_period, ramp_param_id, ramp_card_addr, ramp_step_data_num, ramp_min_val, ramp_max_val, ramp_step_size, ramp_step_phase(optional).

Refer to MCE Command Description for details.

  • Example:
wb cc internal_cmd_mode 0    # Disable internal commanding
wb cc ramp_card_addr 7       # Card id for BC1
wb cc ramp_param_id 0x21     # Parameter id for bias
wb cc ramp_step_data_num 1   # number of data elements for bias 
wb cc ramp_step_period 10    # Number of multiplexing frames between issuing the internal ramp command
wb cc ramp_min_val 0         # Ramp is defined by its min/max and step values.
wb cc ramp_step_size 10      # 
wb cc ramp_max_val 200       # 
wb cc internal_cmd_mode 2    # Enable internal ramp

Card and parameter IDs

To determine the card and parameter ids in your MCE, run "mce_status" with the "-g" option (this option forces a dump of the active mce.cfg hardware configuration file details without issuing any MCE commands). e.g.:

$ mce_status -g
physical   psc        brst                 0x60  1 cards: 0x01
physical   psc        cycle_pow            0x61  1 cards: 0x01
...
physical   bc1        scratch              0x9a  1 cards: 0x07
physical   bc1        flux_fb              0x20  1 cards: 0x07
physical   bc1        bias                 0x21  1 cards: 0x07
physical   bc1        flux_fb_upper        0x24  1 cards: 0x07
...
virtual    sa         bias                 maps: [(0,8)->('rc1 sa_bias'+ 0)] [(8,8)->('rc2 sa_bias'+ 0)]
virtual    sa         offset               maps: [(0,8)->('rc1 offset'+ 0)] [(8,8)->('rc2 offset'+ 0)]
virtual    tes        bias                 maps: [(0,1)->('bc1 bias'+ 0)] [(1,1)->('bc2 bias'+ 0)] [(2,1)->('bc3 bias'+ 0)]

From this dump we see that the "tes bias" virtual parameter is mapped, in this MCE, to the bias card "bias" parameters. We then note that "bc1 bias" corresponds to parameter id 0x21 and card id 0x07.

Timing of Internal Commands

See MCE_Timing_Diagram#Timing_of_Internal_commands