NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Pennarray > MarkIIITopLevel > MarkIIISystem > MarkIIICrate > MarkIIIDFBCard > MarkIIIDFBAlgorithm
   Changes | Index | Contents | Search | Go

The Mark III Digital Feedback Algorithm

WARNING: The number of the bits allocated for certain commanded values is uncertain at the moment, pending confirmation from Josh. Treat the current values as provisional.

Summary

The purpose of the DFB Algorithm is to accumulate data for the telemetry and determine what value to use for the SQUID feedback voltage, determined by a 14 bit DAC value.

Clocks, Row Selects, and Frames.

The Crate backplane provides a basic clock heartbeat (nominally 50 MHz) to all the crate cards. Each clock pulse triggers a sampling of the 12 bit ADC on the data input.

A commandable number of Clock pulses (LSYNC) defines the start of new "Row Selection". (Because of telemetry coordination issues, not all values of LSYNC are useable, see MarkIIIDFBConfiguration?).

The backplane also provides a Frame pulse, which indicates the start of a frame (and equivalent to a new Row Select). The number of row selections per frame is commandable, up to 32 row selections per frame, which are numbered from 0 to 31.

Each row selection has two calculaed values associated with it: a calculated DAC value (14 bit unsigned) and a DFB history value(15 bit signed), H, (used in the active feedback algorithm discussed later).

Feedback Parameter Sets

There are 32 sets of parameters, numbered by a parameter set number from 0 to 31. Each Set consists of:

The choice of which parameter set to be used for a particular row select is governed by a parameter Look Up Table (LUT) filled by commands, and a look up traversal rule, determined by a START, DELTA, and NSTEP commands. The LUT contains parameter set numbers, a 5 bit unsigned value. By default, the LUT contains the values from zero to 31. That is, LUT position n points to parameter set n. For row select zero (the first in the frame), the LUT index is set to START, so that value of LUT(START) is the parameter set used. For subsequent row selects, the INDEX is incremented by DELTA, and parameter set LUT(INDEX) is used.

The ability to define separate parameter sets and how they are traversed gives the Mark III flexability in configuration.

All additional parameters used in the feedback calculation are common for all row selects in the frame.

The SAE

In order to maximize the sensitivity, the ADC measurements are coadded. The first NSKIP (? bits unsigned) samples at the start of a row selection are skipped over (to avoid transient crosstalk from the previous row selection's signal), and then for the next NSAMP (15 bits unsigned) samples, which allows row select rates as low as roughly 1 kHz.

The SAE is the value telemetered to the computer (along with the commanded DAC value, D. Note that the interpretation of the SAE (at least in terms of the ADC counts) requires knowing the values for NSAMP and B.

When running with the feedback loop on, and a reasonable choice for T, then the SAE is expected to be a value in the vicinity of zero. However, when running in "Signal Generator Mode" (when T can be set to zero), the value for the SAE can get quite large. The maximum value that can be expressed in the telemetry depends on whether you are in the short or long mode, but at the very largest it must be expressed as a 22 bit (signed) quantity.

Feedback calculation

The feedback value to be used for the row selection in the next frame can be commanded to be either:

Signal Generator Mode

Here we need a description of the parameters and their use for the signal generator mode.

Control Loop Algorithm

The formal description of the control loop algorithm is that it is a digital proportional-differential feedback, using a two point estimator for the signal slope.

The proportional term will minimize the error signal (SAE) after an impulsive change in the input signal when the SAE range is over values where the SQUID response is essentially linear, with a slope 1/\alpha (SAE Counts per DAC Count). This means that the input signal (in DAC counts) is

\phi = \mathrm{DAC} + \alpha \mathrm{SAE}

up to an arbitrary zero point, and sign for the signal. (Whether increasing DAC corresponds to more or less current in the input coil depends on how the polarity of the input circuit verses the feedback circuit.) If \alpha is positive, then you will lock up where the SQUID response crosses the target ADC on an ascending curve; if negative then on a descending portion. In either case, in the absence of any further change in signal, you minimize the SAE at the next frame by adjusting the DAC to

\mathrm{DAC}_{n+1} = \mathrm{DAC}_n + \alpha \mathrm{SAE}_n.

If you use a value for the loop gain, \alpha, that is less than the optimal value set by one over the SQUID response slope, then you slow the minimization of the SAE (to a time constant of order the ratio of the optimal value to the used value). If the value slightly exceeds the optimal value, you will have damped oscillation about zero for the SAE. If you use a value twice the optimal, then you will not converge, and drive the DAC to one extreme or the other.

In the presence of a variable input signal, a purely proportional control loop will not be able to minimize the SAE, particularly if there is a long term (linear) drift. When the signal is showing a linear variation, the rate of change from one frame to the next can be estimated using the two most recent measurements: \phi_n - \phi_{n-1}. If we assume that the flux at the following frame (n+1) is a change a factor f times that estimated rate, then the optimal feedback for that frame is simply:

\mathrm{DAC}_{n+1} =  (1+f)[ \mathrm{DAC}_n + \alpha \mathrm{SAE}_n ] - f [\mathrm{DAC}_{n-1} + \alpha \mathrm{SAE}_{n-1}]

If f is set to zero, this turns off the differential, or predictor-corrector term, and reduces to the pure proportional control loop. Increasing f to one increases the predictor-corrector term to provide optimal control for linear change in the signal. Note that this algorithm assumes that the value for \alpha used in the terms multiplied by f is actually set to the optimal value. For maximum flexability there should be a second \alpha\prime term just used for the predictor corrector components. However, in performance this distinction can be ignored. (In fact a simplified form where \alpha\prime = 0 and only the DAC values are used provides some of the benefits of the predictor corrector at the cost of additional, but removeable, noise being shifted to the DAC, see the discussion in MarkIIINoise?.)

Control Loop Implementation

For the first step we multiply the (22 bit signed) SAE by a 9 bit (signed) scaled value of alpha to give a 31 bit (signed) unscaled proportional DAC corrector. This is then shifted right (dividing) or left (multiplying) a number of bits depending on a positive or negative value for the feedback scaleing parameter C. (Note, as was the case for scaleing the accumulated error, that the unscaled proportional DAC corrector is a signed quantity, and if it is represented as a twos complement value then shifts right must propagate the sign bit).

If the magnitude of the proportional DAC corrector is less than the THRESHOLD parameter (12 bits?), then it is set to zero.

The proportional DAC corrector is then added to the current DAC value, to get the proportional loop prediction, as a 14 bit UNSIGNED quantity. (Only the bottom 14 bits will be significant, and it should be positive). This means that the sensible range for C will be up to positive 30 and down to negative 14, as values outside that range will have no correction to the DAC, so that C needs to allow a 6 bit (signed) quantity. The value for C, effectively determining the "binary point" for the 9 bit alpha quantity, depends on the magnitude of the value of \alpha in terms of DAC / SAE counts. For a given SQUID implementation in the MUX chips, increasing NSAMP will proportionally decrease \alpha from what it would be for a single sample measurement. Very large NSAMPs (low row select rates) could result in very low magnitudes of $%\alpha$% and require large positive values of C.

The proportional loop prediction is multiplied by f (unsigned 6 bits?), and then shifted right by 5 bits (allowing a maximum value for f to be 1 31/32, and the granularity of f to be 1/32nd. This quantity is the current predictor corrector term. The previous frame's predictor corrector term is retrieved from the dfb history register for the current row select, and replaced with the current predictor corrector. The frame selection's next DAC value (14 bits unsigned) is the sum of proportional loop prediction plus current predictor corrector minus the previous frame predictor.

As a result of certain commands, changes to the target, f, or an update to the lock point by commanding the default DAC value to be used, you can not accurately use the predictor corrector term. As a result of this after such commands a flag is set so that the predictor corrector terms are not applied, so that only the proportional loop prediction is used. (Is this a quanity that is maintained separately for each row selection, or is this behavior applied to all the row selections in a frame? It's OK if it is, we just need to have the documentation show the answer.)

-- RickShafer - 16 Dec 2005

Topic MarkIIIDFBAlgorithm . { Edit | Attach | Ref-By | Printable | Diffs | r1.3 | > | r1.2 | > | r1.1 | More }
Revision r1.3 - 17 Dec 2005 - 17:48 GMT - RickShafer
Parents: WebHome > MarkIIITopLevel > MarkIIISystem > MarkIIICrate > MarkIIIDFBCard
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.