Mce internal ramp

From MCEWiki
Revision as of 14:58, 25 May 2011 by Mhasse (talk | contribs) (Created page with 'The MCE can be set to automatically update certain registers using the Ramp Generator and Arbitrary Waveform Generator features. The script '''mce_internal_ramp''' i…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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. (As of this writing, it supports ramp generation but not arbitrary waveforms.)

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>

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.