Difference between revisions of "Mce internal ramp"

From MCEWiki
(Range selection)
Line 40: Line 40:
 
The range of values over which the ramp occurs is set with the '''--range''' option.  It takes 3 arguments:
 
The range of values over which the ramp occurs is set with the '''--range''' option.  It takes 3 arguments:
 
  --range <min_value> <max_value> <step_size>
 
  --range <min_value> <max_value> <step_size>
 +
 +
'''Note:''' when setting the range, please be aware that internally applied values may have a different meaning than values available at the software level through normal "rb" and "wb" commands.  Particularly in the case of bi-polar DACs on new (Rev E) bias cards, internal values of 32768 correspond to 0V at the DAC output.
  
 
== Update frequency ==
 
== Update frequency ==

Revision as of 17:22, 26 January 2012

The MCE can be set to automatically update certain registers using the Ramp Generator and Arbitrary Waveform Generator features. The script mce_internal_ramp is designed to assist with setting up these internal ramps.

The most subtle thing that the program does is parse the output of "mce_status -g" to determine the card and parameter addresses of the registers being targeted.

The script makes use of the MCE control library mce.py, included with MAS. Ensure that $PYTHONPATH includes /usr/mce/python.

Quick summary

A quick way to set up and run a ramp is like this:

mce_internal_ramp \
 --range 0 1000 10 \
 --target sa bias \
 --offset 8 --count 8 \
 --step-frames 10 \
 go

This will advance the SA bias on RC2 through values 0,10,20,...990,1000,0,10,20,... with updates occuring every 10 multiplexing frames.

Parameter control

Target selection

The best way to select the target register is probably through --target:

--target rc2 sa_bias
--target sq2 fb
--target tes bias

Alternately, use the --stage short-hand:

--stage sa_bias
--stage sq2_fb

Valid stages are {sa,sq2,sq1,tes}_bias and {sa,sq2,sq1}_fb.

When using virtual cards, it will sometimes be necessary to provide an offset and/or a count to help direct the right number of words to the right target card. For example, "sa bias" spans two readout cards, so:

--target sa bias                        # will not work
--target sa bias  --count 8             # will ramp columns 0-7  (RC1)
--target sa bias  --count 8 --offset 8  # will ramp columns 8-15 (RC2)

Range selection

The range of values over which the ramp occurs is set with the --range option. It takes 3 arguments:

--range <min_value> <max_value> <step_size>

Note: when setting the range, please be aware that internally applied values may have a different meaning than values available at the software level through normal "rb" and "wb" commands. Particularly in the case of bi-polar DACs on new (Rev E) bias cards, internal values of 32768 correspond to 0V at the DAC output.

Update frequency

The update frequency can be specified in one of three ways. The most direct is:

--step-frames 10

However, the program is aware of the MCE's multiplexing frequency so you can also pass a frequency in Hz or a period in seconds:

--step-period 0.05
--step-frequency 20.0

Note, however, that the requested frequency will be rounded to the nearest even divisor of the frame rate.

Command actions

Any number of commands can be included in the call to mce_internal_ramp. The allowed commands are:

  • setup: configures the MCE ramp parameters; does not start or stop the ramp.
  • start: start the ramp, using the MCE's current configuration.
  • stop: stop the ramp.
  • go: run the stop, setup, and start commands in succession.

Note that start and stop commands do not require any ramp configuration arguments -- all they do is start or stop the ramp without changing anything else.