Difference between revisions of "Locking slopes"

From MCEWiki
(Plotting controls)
Line 11: Line 11:
 
== Plotting controls ==
 
== Plotting controls ==
  
The following parameters affect plotting of locking slopes in IDL, as well as the choice of initial guesses for lock-points:
+
The following parameters affect plotting of locking slopes in IDL, as well as the choice of starting feedbacks for the next stage of servos:
  
 
* sq2servo_slope in experiment.cfg: (+1 or -1) the sign of the slope in the SQ2 servo plots to which we expect to lock.
 
* sq2servo_slope in experiment.cfg: (+1 or -1) the sign of the slope in the SQ2 servo plots to which we expect to lock.
 
* sq1servo_slope in experiment.cfg: (+1 or -1) the sign of the slope in the SQ1 servo plots to which we expect to lock.
 
* sq1servo_slope in experiment.cfg: (+1 or -1) the sign of the slope in the SQ1 servo plots to which we expect to lock.
 +
 +
In newer versions of auto-tuning, these parameters are ignored and the locking slope is determined from the signs of the servo gains.
  
 
== Consistency between locking and plotting ==
 
== Consistency between locking and plotting ==

Revision as of 11:36, 19 October 2009

MCE/MAS parameters that affect locking slopes

Slope controls

The following parameters in experiment.cfg affect the locking slopes:

  • sq2servo_gain: sets the gain of the SQ2 servo and effectively determines the sign of the SA lock slope.
  • sq1servo_gain: sets the gain of the SQ1 servo and, with the sq2servo_gain, determines the SQ2 lock slope.
  • default_servo_i: determines the I gain of the MCE servo (rc# gaini#), and thus the sign of the locking slopeof the SQ1.

Plotting controls

The following parameters affect plotting of locking slopes in IDL, as well as the choice of starting feedbacks for the next stage of servos:

  • sq2servo_slope in experiment.cfg: (+1 or -1) the sign of the slope in the SQ2 servo plots to which we expect to lock.
  • sq1servo_slope in experiment.cfg: (+1 or -1) the sign of the slope in the SQ1 servo plots to which we expect to lock.

In newer versions of auto-tuning, these parameters are ignored and the locking slope is determined from the signs of the servo gains.

Consistency between locking and plotting

The above slope and plotting parameters should satisfy the following:

  • sq2servo_slope = -sign( sq2servo_gain / sq1servo_gain)
  • sq1servo_slope = -sign( sq1servo_gain / default_servo_i)

These relations follow from the discussion in the sections below.

Violation of the above will likely only result in misleading plots, and not bad locking. Misleading plots can indirectly lead to a user setting up bad locking, however; so keep it clean.

The sa_points.ps plot may be misleading: the code (at time of writing) plots the positive-slope lock-points, regardless of any other parameters.

Future code will eliminate sq2servo_slope and sq1servo_slope and determine all locking slopes from the servo gains...


MCE and tuning servos

Servos

We will need to deal with three servos. One is the "MCE servo", which is the fast servoing of the TES signal via adjustment of the SQ1 feedback. The other two are the auto-tuning SQ2 and SQ1 servos, described [here | auto_setup_squids.pro].

In all cases, the servo is computed by measuring an error (<math>\Delta</math> y), multiplying by a gain (g), and using this to correct the output (x):

<math>\Delta x = g~\Delta y</math>

In the case of the MCE PID loop servo, we run with an I term only so we actually calculate

<math>x = P ~\sum \Delta y</math>

but differentially this is exactly <math>\Delta x = P * \Delta y</math>.

MCE/MAS and sneaky signs

There are no sneaky, extra signs in any of the MCE/MAS servo calculations. This means that given an error (dy) and a gain g, we calculate the change in the feedback (dx) as:

<math>dx = g~dy</math>

and not

<math>dx = -g~dy</math>

There is a sneaky gain in the MCE servo, though; once the default_servo_i is set, the DAC value of the feedback is actually calculated as

<math>\Delta FB = (I~dy) / 2^{12}</math>

But there's no sneaky sign. Just a sneaky gain.

The meaning of the plots

Definition of a lock point

Let the feedback signals on the three stages (in one channel) be <math>x_{SA}, x_{S2}, x_{S1}</math>, and let the error signal be y. Let s be the signal from the TES. The error signal is obviously a function of all 4 numbers:

<math>y = f(x_{SA}, x_{S2}, x_{S1}, t)</math>

But for small variations about one point in this space, we can expand in differentials

<math> dy = a_1 dx_{SA} + a_2 dx_{S2} + a_3 dx_{S1} +  a_4 s</math>

but it is convenient to reparametrize this to resemble the chain of amplifiers:

<math> dy = m_{SA}(dx_{SA} - m_{S2}(dx_{S2} - m_{S1}(dx_{S1} - m_{TES} s)</math>

So the 'slopes' m account for the instantaneous gain between the stages at the lock point.

Open loop ramps

Note that lock points are not ultimately chosen as a result of the open loop ramps. However, it is important to understand the relationship between what the open loop ramps and the settings for the auto-tuning and MCE servos.

For the "SA ramp", we hold <math>x_{S2}, x_{S1}</math> and s constant, and plot y vs. <math>x_{SA}</math>. Thus identifying a lock point permits the measurement of

<math>dy / dx_{SA} = m_{SA}</math>

For the "SQ1 ramp", we hold <math>x_{SA}, x_{S2}</math> and s constant, and plot y vs. <math>x_{S1}</math>. A slope measurement on this curve is a measurement of

<math>dy / dx_{S1} = m_{SA} m_{S2} m_{S1}</math>

Servos

In servos, we ramp one stage's x while adjusting another x to keep the error at zero.

Thus in the "SQ2 servo" step (where SQ2 FB is ramped and SQA FB adjusted) we have:

<math>dx_{SA} = m_{S2} dx_{S2}</math>

However, this can only be accomplished via measurement of the error

<math>\Delta y = -m_{SA} m_{S2} \Delta x_{S2}</math>

so operationally we apply

<math>\Delta x_{SA} = - \Delta y / m_{SA}</math>

This tells us the ideal gain of the SQ2 servo:

<math>g_{S2} = -1/m_{SA}</math>

In the "SQ1 servo" step (where SQ1 FB is ramped and SQ2 FB adjusted) we have:

<math>dx_{S2} = m_{S1} dx_{S1}</math>

so we measure

<math>\Delta y = m_{SA} m_{S2} m_{S1} \Delta x_{S1}</math>

and apply

<math>\Delta x_{S2} = \Delta y / (m_{SA} m_{S2})</math>.

so the ideal gain of the SQ1 servo is

<math>g_{S1} = 1/(m_{SA} m_{S2})</math>.

MCE servo I parameter

When the MCE servo is activated, it cancels changes in TES current by adjusting the SQ1 FB:

<math>dx_{S1} = m_{TES} ds</math>

i.e.

<math>\Delta x_{S1} = -\Delta y / (m_{S1} m_{S2} m_{S3})</math>

and ideal gain is thus

<math>I_{servo} = -1 / (m_{S1} m_{S2} m_{S3})</math>

Consequences for tuning parameters

We have expressed, above, the ideal gains for the servos as a function of the slopes of the ramp and servo curves from auto-tuning. Solving these for the slopes as a function of the ideal gains yields the locking slopes' dependence on the signs of the gains:

SA locking point

The locking slope (on the SA ramp) is determined by the gain in the SQ2 servo:

<math>sgn(m_{SA}) =  -sgn(1/g_{S2})</math>

SQ2 locking point

The locking slope (on the SQ2 servo curve) is determined by the ratio of the gains in the SQ1 and SQ2 servos:

<math>sgn(m_{S2}) = -sgn(g_{S2}/g_{S1})</math>

SQ1 locking point

The locking slope on the SQ1 servo curve is determined by the ratio of the gains in the SQ1 servo and the MCE servo I term:

<math>sgn(m_{S1}) = -sgn(g_{S1}/I)</math>

But the sign of the locking slope on the SQ1 ramp curve is simply:

<math>sgn(m_{SA} m_{S2} m_{S1}) = - sgn(1/I)</math>