Difference between revisions of "Locking slopes"

From MCEWiki
(Plotting controls)
 
(12 intermediate revisions by 3 users not shown)
Line 5: Line 5:
 
The following parameters in [[Mce config template system | experiment.cfg]] affect the locking slopes:
 
The following parameters in [[Mce config template system | 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.
+
* '''sq2_servo_gain''': sets the gain (by column) 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.
+
* '''sq1_servo_gain''': sets the gain (by column) of the SQ1 servo and, along with the sq2_servo_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.
+
* '''default_servo_i''': determines the I gain of the MCE servo (rc# gaini#), and thus the sign of the locking slope of the SQ1.
  
 
== Plotting controls ==
 
== 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:
+
In older versions of the IDL auto-tuning, the following parameters affect plotting of locking slopes and 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.
 
In newer versions of auto-tuning, these parameters are ignored and the locking slope is determined from the signs of the servo gains.
 +
 +
Older code also made use of parameters '''sq2servo_gain''' and '''sq1servo_gain''', specified as one value per readout card.  These have been deprecated in favour of sq?_servo_gain.
  
 
== Consistency between locking and plotting ==
 
== Consistency between locking and plotting ==
Line 28: Line 30:
 
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.
 
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.
+
'''The sa_points.ps plot may be misleading''': older auto-tuning code (still in use all over the place) plots the positive-slope lock-points, regardless of any other parameters. Newer auto-tuning code resolves this.
 
 
Future code will eliminate sq2servo_slope and sq1servo_slope and determine all locking slopes from the servo gains...  
 
 
 
  
 
= MCE and tuning servos =
 
= MCE and tuning servos =
Line 37: Line 36:
 
== 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].  
+
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 [[auto_setup_squids.pro | here]].  
  
 
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):
 
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>
+
:<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
 
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>
+
:<math>x = P ~\sum \Delta y</math>
  
 
but differentially this is exactly <math>\Delta x = P * \Delta y</math>.
 
but differentially this is exactly <math>\Delta x = P * \Delta y</math>.
Line 50: Line 49:
  
 
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:
 
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>
+
:<math>dx = g~dy</math>
  
 
and not
 
and not
<math>dx = -g~dy</math>
+
:<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
 
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>
+
:<math>\Delta FB = (I~dy) / 2^{12}</math>
  
 
But there's no sneaky sign.  Just a sneaky gain.
 
But there's no sneaky sign.  Just a sneaky gain.
Line 65: Line 64:
  
 
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:
 
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>
+
:<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
 
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>
+
:<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:
 
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>
+
:<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.
 
So the 'slopes' m account for the instantaneous gain between the stages at the lock point.
Line 78: Line 77:
 
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.
 
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
+
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>
+
:<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
+
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>
+
:<math>dy / dx_{S1} = m_{SA} m_{S2} m_{S1}\;</math>
  
 
== Servos ==
 
== Servos ==
Line 89: Line 88:
  
 
Thus in the "SQ2 servo" step (where SQ2 FB is ramped and SQA FB adjusted) we have:
 
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>
+
:<math>dx_{SA} = m_{S2} dx_{S2}\;</math>
  
 
However, this can only be accomplished via measurement of the error
 
However, this can only be accomplished via measurement of the error
<math>\Delta y = -m_{SA} m_{S2} \Delta x_{S2}</math>
+
:<math>\Delta y = -m_{SA} m_{S2} \Delta x_{S2}\;</math>
 
so operationally we apply
 
so operationally we apply
<math>\Delta x_{SA} = - \Delta y / m_{SA}</math>
+
:<math>\Delta x_{SA} = - \Delta y / m_{SA}\;</math>
  
 
This tells us the ideal gain of the SQ2 servo:
 
This tells us the ideal gain of the SQ2 servo:
<math>g_{S2} = -1/m_{SA}</math>
+
:<math>g_{S2} = -1/m_{SA}\;</math>
  
 
In the "SQ1 servo" step (where SQ1 FB is ramped and SQ2 FB adjusted) we have:
 
In the "SQ1 servo" step (where SQ1 FB is ramped and SQ2 FB adjusted) we have:
<math>dx_{S2} = m_{S1} dx_{S1}</math>
+
:<math>dx_{S2} = m_{S1} dx_{S1}\;</math>
 
so we measure
 
so we measure
<math>\Delta y = m_{SA} m_{S2} m_{S1} \Delta x_{S1}</math>
+
:<math>\Delta y = m_{SA} m_{S2} m_{S1} \Delta x_{S1}\;</math>
 
and apply
 
and apply
<math>\Delta x_{S2} = \Delta y / (m_{SA} m_{S2})</math>.
+
:<math>\Delta x_{S2} = \Delta y / (m_{SA} m_{S2})\;</math>.
  
 
so the ideal gain of the SQ1 servo is
 
so the ideal gain of the SQ1 servo is
<math>g_{S1} = 1/(m_{SA} m_{S2})</math>.
+
:<math>g_{S1} = 1/(m_{SA} m_{S2})\;</math>.
  
 
== MCE servo I parameter ==
 
== MCE servo I parameter ==
  
 
When the MCE servo is activated, it cancels changes in TES current by adjusting the SQ1 FB:
 
When the MCE servo is activated, it cancels changes in TES current by adjusting the SQ1 FB:
<math>dx_{S1} = m_{TES} ds</math>
+
:<math>dx_{S1} = m_{TES} ds\;</math>
  
 
i.e.
 
i.e.
<math>\Delta x_{S1} = -\Delta y / (m_{S1} m_{S2} m_{S3})</math>
+
:<math>\Delta x_{S1} = -\Delta y / (m_{S1} m_{S2} m_{S3})\;</math>
 
and ideal gain is thus
 
and ideal gain is thus
<math>I_{servo} = -1 / (m_{S1} m_{S2} m_{S3})</math>
+
:<math>I_{servo} = -1 / (m_{S1} m_{S2} m_{S3})\;</math>
  
 
== Consequences for tuning parameters ==
 
== Consequences for tuning parameters ==
Line 126: Line 125:
  
 
The locking slope (on the SA ramp) is determined by the gain in the SQ2 servo:
 
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>
+
:<math>\sgn(m_{SA}) =  -\sgn(1/g_{S2})\;</math>
  
 
=== SQ2 locking point ===
 
=== 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:
 
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>
+
:<math>\sgn(m_{S2}) = -\sgn(g_{S2}/g_{S1})\;</math>
  
 
=== SQ1 locking point ===
 
=== 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:
+
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>
+
:<math>\sgn(m_{S1}) = -\sgn(g_{S1}/I)\;</math>
 +
 
 +
But the sign of the locking slope on the '''SQ1 ramp''' curves is simply:
 +
:<math>\sgn(m_{SA} m_{S2} m_{S1}) = -\sgn(1/I)\;</math>
  
But the sign of the locking slope on the SQ1 ramp curve is simply:
+
[[Category:Tuning]]
<math>sgn(m_{SA} m_{S2} m_{S1}) = - sgn(1/I)</math>
 

Latest revision as of 20:22, 28 April 2017

MCE/MAS parameters that affect locking slopes

Slope controls

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

  • sq2_servo_gain: sets the gain (by column) of the SQ2 servo and effectively determines the sign of the SA lock slope.
  • sq1_servo_gain: sets the gain (by column) of the SQ1 servo and, along with the sq2_servo_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 slope of the SQ1.

Plotting controls

In older versions of the IDL auto-tuning, the following parameters affect plotting of locking slopes and 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.

Older code also made use of parameters sq2servo_gain and sq1servo_gain, specified as one value per readout card. These have been deprecated in favour of sq?_servo_gain.

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: older auto-tuning code (still in use all over the place) plots the positive-slope lock-points, regardless of any other parameters. Newer auto-tuning code resolves this.

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.

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 curves is simply:

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