Coil Design for Strongly Curved Magnets Based on the Differential Geometry of the Frenet Frame

Recent accelerator projects for radiation-therapy centers demand strongly curved magnets in transfer lines and gantries. Several advances have been achieved in designing and manufacturing strongly curved, cosine-theta, and canted-cosine-theta type magnets. This article presents a new computer-aided design (CAD) engine for generating coil geometries for various types of mandrel surfaces (elliptical, curved, conical) and interfacing with field simulation software as well as CAD tools. The CAD engine is based on the differential geometry of the Frenet frame and allows the analytical computation of the curvature parameters, such as curvature, twist, and torsion. Applying the theory of developable surfaces it is possible to generate conductor geometries with zero Gaussian curvature, which are particularly interesting for strain-sensitive supercondors such as high-temperature superconductor tapes.

Coil Design for Strongly Curved Magnets Based on the Differential Geometry of the Frenet Frame

Melvin Liebsch and Stephan Russenschuck
Abstract-Recent accelerator projects for radiation-therapy centers demand strongly curved magnets in transfer lines and gantries.Several advances have been achieved in designing and manufacturing strongly curved, cosine-theta, and canted-cosinetheta type magnets.This article presents a new computer-aided design (CAD) engine for generating coil geometries for various types of mandrel surfaces (elliptical, curved, conical) and interfacing with field simulation software as well as CAD tools.The CAD engine is based on the differential geometry of the Frenet frame and allows the analytical computation of the curvature parameters, such as curvature, twist, and torsion.Applying the theory of developable surfaces it is possible to generate conductor geometries with zero Gaussian curvature, which are particularly interesting for strainsensitive supercondors such as high-temperature superconductor tapes.

I. INTRODUCTION
S TRONGLY curved accelerator magnets, with bending radii in the 1-m range, are used in gantries for ion beam radiotherapy [1], spectrometer magnets [2], and low energy accelerators [3].
Curved canted-cosine-theta (CCT) magnets [4] make use of a pair of nested, tilted coils on a mandrel with the shape of a torus section.These magnets have been proposed by several authors for the application in radiotherapy [5], [6], [7], [8] and spectrometry [2], as they enable large apertures and curvatures, as well as combined-function fields.
Strongly-curved cosine theta (cos(θ)) magnets build on the design procedures of straight magnets and have been proposed as bending magnets in radiotherapy in [9] and [10].
Particularly for strain-sensitive superconductors such as hightemperature superconductors (HTS), the minimum curvature radii required in the coil-head of cos(θ) magnets can be too low.The unilayer magnets proposed in [11] for straight, high-field magnets can provide a solution to this problem, and may also be of interest for strongly curved magnets in future applications.In all cases, the mechanical constraints resulting from the flexural rigidity of the superconducting cable must be respected to ensure that it can be wound onto the mandrel.In this respect the strain energy is an important design parameter.The variable t ∈ [0, L] parameterizes the winding path, and L is the cable length.The flexural rigidities f τ , f κ n and f κ g , relate the strain energy to the curvature parameters τ r , κ n and κ g , which are the normal curvature, geodesic curvature and relative torsion [12].Differential geometry methods have been developed to optimize coil-heads of straight cos(θ) magnets in [13].These methods have become a standard tool for the coil-head design in the computer program ROXIE [14].
Especially for the three-dimensional design of coils using ReBCO tape superconductors, differential geometry has been applied in [15] for straight cylindrical magnets and in [16] also for curved magnets.In [16] the tape surface was developed from a baseline expressed by Bézier splines.This allows for a sufficiently smooth baseline and the efficient evaluation of its derivatives.Complications arise, however, if the baseline is restricted to lie on a given mandrel surface.
Recent accelerator magnet designs make use of a vast variety of mandrel surfaces, such as strongly curved, conical, or elliptic ones, and even combinations of those.To cope with these coil winding geometries, a new CAD engine for the coil geometry design has recently been implemented for ROXIE.It is based on a new method for the representation of the baseline as a composed function of a winding path and mandrel surface.This method is explained in this article.
The composition restricts the baseline to lie on a desired mandrel surface.This is not a necessary condition for an optimal solution but is often desired to facilitate the manufacturing process.The proposed method is versatile in the sense that differential geometry methods can be applied to all of the aforementioned cases, and it is easily extendable due to its template-based software architecture.Moreover, an automatic differentiation method is developed for the computation of the baselines derivatives, which are needed for differential geometry methods.
In the last section of this article, we present an algorithm to derive a volumetric basis spline (B-spline) representation of the conductor, to establish an interface to CAD tools and software.In the magnet design, the conductor strain and field quality optimization go hand in hand.In this article, we limit the discussion to the computational aspects related to the conductor design.An article about the field quality optimization is currently in preparation.
The algorithms presented in this paper, as well as the interface to ROXIE, have been implemented in python.All algorithms can be made available in a Gitlab repository on request.

II. DIFFERENTIAL GEOMETRY FOR COIL DESIGN
Let us briefly introduce the concepts of differential geometry required for accelerator magnet design; for details and derivations see [12], [17, ch. 19], and the appendix of [16].
The conductor geometry is defined by the baseline r(t) : R → R 3 , to which the triad of vectors (T (t), N (t), B(t)) is attached.This triad of orthogonal vectors is the Frenet frame.Subsequently, we omit the notation of the time dependence.
The vectors T , N and B are the tangential, normal and binormal vectors, and are uniquely determined by the baseline where f denotes the derivative df /dt.The curvature κ and the torsion τ are the fundamental parameters for the strain-energy computation and are also uniquely determined by the baseline If the cable cross-section is rendered in the (N , B), the hard-way bending is minimized by aligning the wide side of the cable with the bi-normal vector; see Fig. 1(a)).
In some cases, the flexural rigidity of the cable allows for some hard way bending, and thus it is possible to render the cable cross-section in a rotated frame (T , n, b), where The rotation angle ϑ is the cable twist and the curvature parameters for the strain-energy calculation according to (1) are If we consider the bi-normal vector b to be normal to an underlying surface, the triplet (T , n, b) is known as the Darboux-frame; see Fig. 1(b).Winding a cable for a CCT magnet according to the Darboux frame facilitates manufacturing but introduces hard-way bending.The cable twist can be determined by If there is torsion, τ > 0, and the surfaces that are traced out by the normal and bi-normal vectors in both, Frenet and Darboux frames are not developable.This implies that they cannot be deformed into a flat ribbon while preserving the arc lengths of arbitrary curves defined on these surfaces.However, when using ribbon-like conductors such as HTS tapes, the optimal winding path must result in a developable surface to avoid conductor damage and degradation.The ribbon may be defined as a surface with where w is the ribbon width.The scaled vectors g(t)D(t) are known as generators and D is the Darboux vector defined as For the derivations of the above equations see [13] and [17].Fig. 1 shows windings generated by using the Frenet-(a) and Darboux frames (b) as well as the ribbon Γ (c) for two turns of a CCT quadrupole.

r(t) = Θ • χ(t).
In this way, the baseline is constrained to lie on the mandrel surface Θ.
A curved, elliptical, and conical mandrel surface may be defined as with the orbit Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.The vectors e x , e y and e z denote the coordinate vectors of the Cartesian frame and e u is the unit vector This mandrel surface has a curvature radius of ρ and it is centered at the origin for σ = 0.By means of the arclength-dependent radii R u (σ) and R y (σ), conical and elliptic mandrel surfaces are also possible.Any at least C1 -continuous function R → R 2 may be used as a winding path.However, for the calculation of the curvature parameters and the Darboux vector, two additional derivatives are required and the function needs to be at least C 3 -continuous. 1 The winding path objects for cos(θ) coil-heads are based on the super-ellipses [17, eq. (19.50)]For CCT magnets, the tilted helices are used, where M (t) = N n=1 B n sin(nt) + A n cos(nt) is a modulation function with normal -and skew amplitudes, B n and A n , and e(t) is an evolution function represented by Bsplines [18].
Moreover, to cope with more general winding paths, an object using non-uniform rational basis splines, short NURBS [19], is available in our code.In this case, the winding path in the (ϕ, σ)-parameter domain is modeled with ease, by placing and adjusting the positions and weights of the control points.
It is possible to classify magnet design procedures by means of their characteristic footprints in the (ϕ, σ)-parameter domain.In Fig. 2 we illustrate the footprints of cos(θ), CCT, and unilayer magnets.In the latter example, the NURBS-based winding path is used.The resulting baselines for a toroidal mandrel surface are shown in Fig. 3.

IV. AUTOMATIC DIFFERENTIATION
For the computation of the curvature parameters based on (3) the first three derivatives of the baseline are required.For this reason, an automatic differentiation method has been developed.This method is based on Faá di Bruno's formula for higher derivatives of composed functions.A general rule for the n-th derivative can be found in [20,Collary 2.11].For the sake of brevity, we give only the explicit formulas for the first two derivatives.The first derivative is and the second derivative is For the numerical computation, the python classes for the mandrel and the winding paths are equipped with functions for the evaluation of all derivatives up to order n = 3.
Because the automatic differentiation method is based on evaluating the chain rule analytically, it is accurate to machine precision.This has been validated using the symbolic calculation toolbox sympy [21].

V. BASIS SPLINE REPRESENTATION
Three-dimensional objects are represented in CAD and product manufacturing tools by higher-order volume parameterizations (solids), which are described by NURBS.Our code features a STEP file export that complies with the ISO 10303-21 standard for product-data representation and exchange [22].Based on the baselines r i (t) with i = 1, 2, 3, 4 for the four edges of the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.conductor according to Fig. 4, a solid is defined as with r, s ∈ (−1, 1).A volumetric spline representation is obtained if the baselines r i (t) are described by B-splines as well.
A three-dimensional B-spline curve of degree k is defined by a linear combination of L basis functions b with the spline control points c (20) See [18] for more details.
We use the adaptive knot vector refinement according to Table I to fit 3D B-spline curves to the edges of the conductor.In this way, fitting errors are controlled to be smaller than the machining tolerance, which is typically in the range of 10 µm.The function refine_knot_vector inserts new knots to the intervals with the largest 20 % of the sum of all error indicators e j .By default, we make use of splines with degree k = 3.

TABLE I ADAPTIVE KNOT VECTOR REFINEMENT
It is possible to apply the algorithm of Table I for the design of end-spacers and wedges for cos(θ) magnets.An example is shown in Fig. 4 (top-right, bottom).One B-Spline curve is fitted to the baseline of the first of the blocked cables.A second B-Spline curve is fitted to the intersection curve of a scaled mandrel surface and the ribbon surface, which is spanned by the Darboux vector D. Finding the intersection curve is formulated as a root finding problem f (λ) − g(λ) = 0 and is solved by Newton's method.

VI. CONCLUSION
The recent demands for strongly curved accelerator magnets have brought new challenges to magnet design and manufacturing.Moreover, future accelerator magnets will use more strainsensitive superconductors.The new CAD engine for ROXIE is tailored particularly to the design of strongly curved accelerator magnets.The coil geometry is developed from a baseline, which is restricted to a given mandrel surface.Due to the templatebased definition of winding path and mandrel surface, the method is versatile and allows to model a vast viarity of magnet types rapidly.The automatic-differentiation method enables the accurate determination of curvature parameters, which are the basis for the strain energy, and Darboux vector calculation.The CAD engine features interfaces to advanced visualization tools and mesh generators (vtk, gmsh), and also a STEP file export for product manufacturing tools, which is based on a B-Spline representation of the solid conductor.

Fig. 1 .
Fig. 1.Winding frames illustrated for two turns of a quadrupole CCT magnet.(a) The Frenet frame and a conductor winding with no hard-way bending.(b) A Darboux frame is generated by setting b = e r where e r is the mandrel surface normal vector (blue).(c) A ribbon Γ is generated by the Darboux vector D (white).The ribbon is a developable surface and therefore suitable for HTS tapes.

Fig. 2 .
Fig. 2. Magnet design techniques can be classified by their characteristic footprints in the (ϕ, σ)-parameter domain.For better visibility, only a few turns are shown in all cases.
) where a, b ∈ R and m, n ∈ N.

Fig. 3 .
Fig. 3. Coils wound on curved toroidal surfaces.The windings correspond to the footprints shown in Fig. 2.

Fig. 4 .
Fig. 4. Top-left: Four corner baselines define the boundary surfaces of a solid object.Top-right: The intersection curve (red) of the developed surface (green vectors) and a scaled mandrel surface (orange).Bottom: A CAD view of the end-spacer (blue).The black grid illustrates the coil geometry.