The Optimization Algorithm
The algorithm used to tune the HRS Multipole aims to minimize the distance between the components composing the centroid of the beam and the center of the beam. It takes advantage of a superposition trait of the multipole that can be stated by first making the following definitions.

  • $\phi_{i}$ is the potential on the $i^{th}$ electrode pair
  • $x_{I}(x')$ is the initial position of the centroid at a given $x'$
  • $x_{F}(x')$ is the new position of the centroid at the given $x'$
  • $\Delta{x}_{i}(x')$ is the change in position at a given $x'$ caused by applying a 1V potential to the $i^{th}$ electrode pair
We can then state the superposition relationship as follows: $$x_{F}(x') = x_{I}(x') + \sum_{i=1}^{23}{\phi_{i}\Delta{x}_{i}(x')}$$ If we use $x_{D}(x')$ to represent the desired position then the total deviation can be calculated using the function $f$: $$f = \sum_{x'}{\left | {x_{D}(x')} - {x_{I}(x')} - \sum_{i = 1}^{23}{\phi_{i}\Delta{x}_{i}(x')} \right |}$$ For a given beam we can use $x'_{U}$ and $x'_{L}$ to denote the upper and lower limits on $x'$ respectively. Then our problem can also be formulated into a matrix equation. $$ \begin{bmatrix} x_{F}(x'_{U}) \\ \vdots \\ x_{F}(x'_{L}) \\ \end{bmatrix} = \begin{bmatrix} x_{I}(x'_{U}) \\ \vdots \\ x_{I}(x'_{L}) \\ \end{bmatrix} + \begin{bmatrix} \Delta{x}_{1}(x'_{U}) & \cdots & \Delta{x}_{23}(x'_{U}) \\ \vdots & \ddots & \vdots \\ \Delta{x}_{1}(x'_{L}) & \cdots & \Delta{x}_{23}(x'_{L}) \end{bmatrix} \begin{bmatrix} \phi_{1} \\ \vdots \\ \phi_{23} \\ \end{bmatrix} $$ This can be rewritten as $\vec{x}_{F}(x') = \vec{x}_{I}(x') + A\vec{\phi}$. We can then apply the method of least squares to $\vec{x}_{D} = \vec{x}_{F}$ since we need to minimize the difference between these two vectors. Since this system is normally overdetermined, it is useful to loop through different possible sets of equations and then choose the optimal set.
The CANREB HRS
HRS Schematic
TRIUMF 2017