Difference between revisions of "Ramp Generator"

From MCEWiki
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
* The MCE can be set to write values to internal registers.  For arbitrary shapes, see [ Arbitrary Waveform Generator ].
+
* 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.
 
* 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.
  
= Commands and Usage =
+
'''For script-level support: see [[mce_internal_ramp]].'''
* Commands:
 
** '''internal_cmd_mode (0xB0):'''  Enable or disable internal housekeeping/ ramping commands.  Default = 0.
 
*** mode = 0:  Disable internal commands
 
*** mode = 1:  Enable Housekeeping commands
 
*** mode = 2:  Enable ramp commands
 
*** mode = 3: Enable arbitrary waveform (AWG) commands
 
** '''ramp_step_period (0xB1):''' Specify the number of frame periods between each ramp step.
 
** '''ramp_param_id (0xB5):'''  Specify the parameter ID of the register to be ramped.
 
** '''ramp_card_addr (0xB6):'''  Specify the card address of the register to be ramped. 
 
** '''ramp_step_data_num (0xB7):'''  Specify the number of data that are to be written per ramp command.
 
  
* Usage:
+
== 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 [http://www.phas.ubc.ca/~mce/mcedocs/software/SC2_ELE_S580_515_mce_command_description.pdf MCE Command Description] for details.
 +
 
 +
* Example:
 
  wb cc internal_cmd_mode 0    # Disable internal commanding
 
  wb cc internal_cmd_mode 0    # Disable internal commanding
wb cc ramp_step_period 10    # Period, in internal MCE frames.  Don't go too low here.
+
  wb cc ramp_card_addr 7       # Card id for BC1
  wb cc ramp_card_addr 2       # Card id (Clock Card, for example)
+
  wb cc ramp_param_id 0x21     # Parameter id for bias
  wb cc ramp_param_id 0x99     # Parameter id (LED, for example)
+
  wb cc ramp_step_data_num 1  # number of data elements for bias
  wb cc ramp_step_data_num 1  #  
+
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
 
   
 
   
wb cc internal_cmd_mode 3    //Enable internal AWG commands AFTER writing the data!!!
 
 
wb cc data_rate 10
 
wb cc ret_dat_s 1 1000
 
go cc ret_dat 1
 
  
= Card and parameter addresses =
+
== 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)]
  
= Firmware Details =
+
From this dump we see that the "tes bias" virtual parameter is mapped, in this MCE, to the bias card "bias" parametersWe then note that "bc1 bias" corresponds to parameter id 0x21 and card id 0x07.
* Implementation:
 
** To enable the AWG internal commands, you set '''internal_cmd_mode''' = 3, as shown in the usage, above.
 
** The AWG value is applied immediately following a data packet, and appears in index 7 of the next data-packet headerThis index is called "Ramp Value", and is also used to report the ramp value when the MCE is in internal ramp mode (internal_cmd_mode = 2)
 
  
 +
== Timing of Internal Commands ==
 +
See [[MCE_Timing_Diagram#Timing_of_Internal_commands]]
  
* Commands of note:
+
[[Category:Clock Card Firmware]]
** internal_cmd_mode
 
** ramp_step_period
 
** ramp_min_val
 
** ramp_step_size
 
** ramp_max_val
 
** ramp_param_id
 
** ramp_card_addr
 
** ramp_step_data_num
 

Latest revision as of 18:53, 31 August 2016

  • 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