On the angular control of rotating lasers by means of line calculus on hyperboloids

We propose a new paradigm for modelling and calibrating laser scanners with rotation symmetry, as is the case for Lidars or for galvanometric laser systems with one or two rotating mirrors. Instead of bothering about the intrinsic parameters of a physical model, we use the geometric properties of the device to model it as a specific configuration of lines, which can be recovered by a line-data-driven procedure. Compared to universal data-driven methods that train general line models, our algebraic-geometric approach only requires a few measurements. For example, a galvanometric laser scanner with two mirrors is modelled as a grid of hyperboloids represented by a grid of 3x3 lines, providing a new type of lookup table: containing not more than 9 elements, lines rather than points, where we replace the approximating interpolation with exact affine combinations of lines. The proposed method is validated in a realistic virtual setting. As a collateral contribution, we present a robust algorithm for fitting ruled surfaces of revolution on noisy line measurements.


Introduction
The intrinsic calibration of a sensor is typically done by determining a number of parameters in some proposed sensor model that aims to represent the physical reality of the involved hardware Sturm et al (2011); Hartley and Zisserman (2004). Often, this strategy implies non-flexible models with unstable parameter values (Lu and Payandeh (2010); ZC (1993), Chapter 3 in Van Hamme (2016)). In spite of its rich tradition and literature, calibration remains a tedious and time consuming task, to be repeated when conditions change, not always obtaining the required accuracy. The shortcomings of the calibration by matching a rigid physical device model have recently been admitted by leading scientists in the field Schöps et al (2019). The inaccuracies and instabilities inherent to the current calibration procedures are troublesome in applications where intrinsic localization, registration and sensor fusion are involved Dimitrievski et al (2019). And last but not least, intrinsic calibration procedures based on a physical model cope with the determination of physical parameters that can rarely be measured directly, and are moreover rather virtual than physical, due to the idealised abstract nature of the model.
An alternative strategy is the so-called universal-model-based method, which considers a sensor as a black box that connects its control variables (camera pixel coordinates, mirror angles for laser reflection,. . . ) to the observed world. The calibration of this mapping is established by a data-driven procedure, requiring the availability of sufficiently large datasets that allow interpolation Schöps et al (2019); Peternell and Pottmann (1999), or lookup tables Cao et al (2020), or the training of neural networks or Gaussian processes Roitsch et al (2019); Wissel et al (2015); Sagan et al (2022); Mallasto and Feragen (2018); Boi et al (2022). An important issue of this approach is that it requires world point clouds with reliable coordinates, which significantly cover the work space.
In this article we make use of geometric sensor models, assigning a world line for each sensor query Grossberg and Nayar (2005); Ye and Yu (2014); Ponce et al (2017a); Breiding et al (2018). Lines naturally present the way how many sensors observe the world (beams of light). Our approach still assumes a specific model, given by a line variety (in the algebraic geometric sense). But it bypasses the intrinsic physics of the device. The lines that belong to this line model, can be obtained by direct measurements, as opposed to the parameters of a physical model-based calibration. A practical drawback of line measurements might be that they require to determine the position of several collinear points. However, this extra work is awarded with the possibility to reduce noise and outliers for point measurements by means of robust line fitting Fischler and Bolles (1981a). Furthermore, a line model provides stable transformations to other reference frames (extrinsic calibration Sels et al (2018); Fusiello et al (2015); Miraldo and Araujo (2014)). The calibration algorithms as presented in Miraldo and Araujo (2015); Trager et al (2017a); Ponce et al (2017a) are line-model-based, but they still use (non-obvious) parameter models and appear to be too complicated for practical purposes. Alternatively, some authors avoid restrictions on the involved line variety, calibrating a universal line model through a data-driven learning process Tu and Zhang (2018); De Boi et al (2022); Breiding et al (2018). These universal approaches have the advantage that they are not based on geometric assumptions (except for the straight line assumption), but they need the availability of a large set of line measurements and suffer from a lack of theoretical accuracy guarantees. This paper demonstrates the profit of proposing a specific type of line variety as sensor model, supported by natural geometric assumptions. In this way, we compromise between model-line-based and data-line-based approaches.
In many applications we use a sensor that corresponds to a two-dimensional line variety (a camera with two pixel coordinates, a laser scanner with two control parameters,. . . ), which is called a line congruence Trager et al (2017b); Ponce et al (2017b); Tas and Gürsoy (2018).
In this article we elaborate line-model sensors with rotational symmetry, as it is the case for scanners with rotating lasers (Lidar) or for a galvanometric laser scanning system where a fixed laser beam is reflected by one or two rotating mirrors. We prove that the corresponding line varieties are covered by ruled quadratic surfaces of revolution As an important application, we present a novel, fast and efficient linebased calibration procedure for a two-mirror galvanometric laser scanner (2M-GLS) ( Figure 2). These laser scanners appear in several applications Stafne et al (2000); Duma and Duma (2017); Li (2008); Pokorny (2014) due to their "good characteristics of high deflection speed, high positioning repeatability and concise structure" Tu and Zhang (2018). For the majority of the publications, the authors restrict to situations where a 2M-GLS measures a plane or a two-dimensional surface Mao et al (2018). In such situations there is no need to go beyond point-based calibrations. However, for a complete 3D-range, sensor calibration must provide the 3D-line (in some reference frame) for each selected pair of rotation angles of the two mirrors that reflect a fixed incoming laser beam. Model-based methods for the 3D-calibration of a 2M-GLS are given by Manakov et al (2011);Cui et al (2009). However, these methods have to determine (too) many parameters of (a model of) the device geometry. They cope with the disadvantages that are listed at the beginning of the introduction (unstable and tedious to implement), giving rise to non-convex optimization problems that suffer from local minima. In Tu and Zhang (2018); De Boi et al (2022) the authors propose to calibrate a 2M-GLS by a data set of line measurements, which is more related to our approach. However, their method completely differs from the proposed procedure, because they calibrate a universal line model through a statistical learning process, without bothering about the algebraic and geometric structure of the involved line congruence.
In order to present the mathematical tools for this article in a self-contained manner, we provide the complete description of the hyperboloids or cones of revolution that are obtained by the laser reflections in the case of one rotating mirror (Section 2). This leads to the specific Plücker coordinates of these laser reflections as presented in Section 3. As a collateral application, we present a robust algorithm in the Appendix for recovering a ruled surface of revolution from noisy line data. An important contribution and innovation in this article appears in Section 5, where we derive a representation of the lines of one hyperboloid of revolution as a stable one-parameter combination of three generating lines, directly related to the angular variable that controls the mirror rotation. This result was accomplished thanks to the rational parameterization of affine combinations on the circle as presented in Section 4. In Section 6 we show how this result yields an algorithm to predict laser reflections, first for one rotating mirror, and then extended to the concept of a three by three hyperboloid grid for modelling and calibrating a two-mirror galvanometric laser scanner (Section 7).
We believe that this article offers a novel and fundamental contribution to the field of sensor modelling and calibration, especially useful for laser scanners with rotational components. We show how certain sensors can be represented by line congruences that on their turn can be represented by a limited base set of lines. For example, a galvanometric laser scanner with one mirror can be represented by 3 lines, and in the case of two mirrors by 9 lines. We discovered how to generate the whole line congruence from these bases by a linear line calculus that is directly related to the angular control parameters. The correctness of our hyperboloid grid method is validated by mathematical proofs, the accuracy and stability by the synthetic experiments in Section 8, by means of a virtual 2M-GLS that simulates real world hardware. We observe a very accurate and precise performance, as well as a favourable comparison with the databased calibration of Boi et al (2022) that is known to outperform physical parameter models and to match other statistical learning models. This success is mainly explained by the stability of the calculus on hyperboloid grids introduced in Section 5 (validated in Section 8), due to the use of a stable rational parameterization to represent the mirror rotation. In addition, the line-based algorithm for fitting ruled quadrics of revolution, as presented in the Appendix, definitely improves the robustness of the proposed calibration method.

Line reflections by rotating mirrors
This section describes the well known geometry of the reflections of a fixed incoming laser beam with a mirror that rotates about a fixed axis, offering the opportunity to introduce our terminology. We assume that this rotation axis A, the laser beam L and its reflections can be modelled by (straight) spatial lines, and the mirror by a (flat) plane that contains the axis A. Typically, only one side of this rotating performs mirror reflection, such that it makes no sense to allow a rotation angle range that exceeds 180 • . For most physical devices, this range is even more restricted.
A particular position of the rotating mirror M(n) is determined by its unit normal n, which is supposed to point in the sense of mirror reflection. So, if the laser L is directed by the unit vector r L , compatible with the incoming orientation, then the reflected line R(n) has direction vector r n (according to the orientation of reflection): r n = r L − 2(r L · n)n. (1) Further, let us agree that the normalised direction of the mirror rotation axis A is denoted by r A , and the plane through the origin and perpendicular to A by D 0 (Figure 1). Notice that D 0 differs from the plane containing r L and r n , unless the incoming laser happens to be orthogonal to A. For this reason we decompose (incident and reflected) line directions r in a component along A and a component perpendicular (2) We will always assume that the incident laser hits (is not parallel to) the mirror, so r ⊥ is not the zero vector. Let R(n 1 ) and R(n 2 ) be reflections of the same incident laser L for different mirror positions M(n 1 ) and M(n 2 ) during the rotation about axis A. Let r 1 and r 2 abbreviate r(n 1 ) and r(n 2 ) respectively ( Figure 1). Proposition 1.
1. r 1 = r 2 . 2. R(n 1 ), R(n 2 ) and L cross A at equal distance, sharing a common closest point p on A. So, if D p denotes the plane through p and perpendicular to A, then p is the center of a circle C p in D p , intersecting L, R(n 1 ) and R(n 2 ) in q, q 1 and q 2 , respectively. Furthermore: Proposition 1 implies that all line reflections of a fixed laser by a continuously rotating mirror (over some angle range) can be equally well obtained by the continuous rotation of the first reflected line (over the double range). It is a well known geometric fact that the rotation of a line around a given fixed axis A sweeps a one-sheeted hyperboloid of revolution HOdehnal et al (2001). H can be considered as a union of lines but equally well as the union of circles (perpendicular to A). The smallest of these circles, C p in Proposition 1, is called the gorge circle of this surface of revolution. We conclude in the following theorem, where we take care for the singular situations: Theorem 1. If the incoming laser beam L is not perpendicular to the mirror rotation axis A, and if L ∩ A = ∅ then the reflected lines belong to one system of rulers of a one-sheeted hyperboloid of revolution, H(L, A), completely determined by L and A. Indeed, the gorge circle of H(L, A) is given by C p , and its pitch ρ by: The incoming laser L belongs to the second system of rulers on H(L, A). If L intersects A, then H(L, A) degenerates into a cone, or even into a flat pencil if L happens to intersect A perpendicularly. Finally, if L ⊥ A and L∩A = ∅, then H(L, A) degenerates into the set of tangents to C p in D p . The next step is to consider a 2M-GLS, a sensor consisting of a single fixed laser L that is internally reflected by two sequential mirrors, each rotating about an individual axis, denoted by A and B in order of reflection. The control of the individual rotating mirrors is typically galvano-driven, allowing two independent user parameters, denoted by α and β respectively ( Figure 2).  Note that we only observe the outgoing lasers of the galvanometer after the second reflection by the mirror M(B, β) that rotates about the axis B. An arbitrary value of the parameter α that controls the position of the first mirror M(A, α), generates a reflection L(α) of the initial laser L, which is on its turn the incident laser for the rotating mirror M(B, β). Because the laser line that is generated by a 2M-GLS is determined by a pair of angle settings (α, β), it can be denoted by R(α, β). Theorem 1 translates into: Theorem 2. The outgoing lasers R(α, β) of a 2M-GLS lie on a family of (possibly degenerate) co-axial hyperboloids of revolution H(L(α), B), each of which is generated by an individual laser L(α) that is reflected by rotating the second mirror M(B, β).
Varieties of lines with two degrees of freedom, such as the line reflections produced by two rotating mirrors, are called line congruences Tas and Gürsoy (2018). In our case we coin the name two-mirror congruence.
Warning: The centres of the different hyperboloids H(L(α), B), being the points p(α) on B with minimal distance to L(α), are not equal (except in degenerate cases). Therefore, the congruence of laser lines emitted by a 2M-GLS does not constitute a linear line congruence Pottmann and Wallner (2001) If we consider the intermediate state of the sensor, after the first rotating mirror M(A, α), then the reflected beams of the incoming laser L also lie on a hyperboloid, H(L, A). If we fix the second mirror at position β 1 , M(B, β 1 ), while rotating the first mirror, then we observe the sensor emitting a mirror reflection of H(L, A) by M(B, β 1 ). Of course, this mirror image is also a one-sheeted hyperboloid of revolution, denoted by H(L, A, B, β 1 ), containing the doubly reflected laser beams R(α, β 1 ) (with varying α). Consequently, we can be more specific about the description of the two-mirror congruence as given by Theorem 2. Corollary 1. The outgoing lasers R(α, β) of a 2M-GLS belong to a congruence that can be considered as the disjoint union of either of the following two systems of hyperboloids of revolution: 1. A system of (co-axial) hyperboloids, each of them determined by lines R(α 1 , β) with constant α 1 . 2. A system of hyperboloids with each of them determined by lines R(α, β 1 ) with constant β 1 .
Observe that the axes of the second system of hyperboloids in Corollary 1 sweep an additional hyperboloid of revolution, not participating in the two-mirror congruence, but sharing its axis with the hyperboloids of the first system.

Plücker coordinates of reflections of a single laser by a rotating mirror
We refer to Pottmann and Wallner (2001) for an introduction to line coordinates and line geometry in a projective geometric setting, or to Odehnal et al (2001) for a Euclidean definition of line coordinates. In our context it is natural to work over the real numbers R as a base field. A line R in Euclidean 3-space is determined by its direction vector r and a point q. In order to get rid of the randomness in selecting q on R, we replace q by the moment m = q × r, which is independent of the choice of q on R, and only depends on the scale of r. Observe that q × kr = k(q × r), so the sixtuple (r, m) gives well defined homogeneous coordinates for R, Plücker coordinates, mapping this line in 3-space to a point π(R) in P 5 . Furthermore, since r · m = 0, this point belongs to the so-called Klein quadric K in P 5 : It can be proven that every point of K either represents the Plücker coordinates of a Euclidean line, or it represents a "line at infinity" (where x 1 = x 2 = x 3 = 0). Finally, for a Euclidean line R, we can tie down the random homogeneous factor by normalizing its direction vector: ||r|| = 1. To avoid the final ambiguity, we will always assume that each line R has a given orientation.
A major objective of this paper is to control the Plücker coordinates of the laser reflections by means of the rotation angle of the mirror. In order to present the algebraic calculus of laser reflections more easily, we will assume for the moment that the origin coincides with the point p ∈ A that has minimal distance to the incoming laser L, implying that D 0 = D p (Section 2). Later we will see that this choice does not affect the derived formulas.
Recall form Proposition 1 that the laser reflections R(n) corresponding to different positions M(n) of the rotating mirror share an identical pitch ρ = r n · r A , where we assume that the direction vectors r n (of R(n)) and r A (of the rotation axis A) are normalised and oriented such that ρ > 0. Consequently, the projections r ⊥ on D 0 of the reflected directions r all have identical norm ||r ⊥ || = 1 − ρ 2 . Furthermore, Proposition 1 implies that each r ⊥ is perpendicular to q n − p = q n = R(n) ∩ D 0 (= closest point of R(n) to the axis A). If L does not intersect A, all these points q n belong to the gorge circle C 0 of the hyperboloid H(L, A) with radius σ 0 = ||q|| (Figure 1). Finally, recall that the relative (oriented) angles of rotation between the reflected lines R(n) are determined by the mirror rotation M(n): Our next observation is that the moments m n = q n × r n of the reflected lines R(n) appear to behave in a similar way as the directions. Except for the special case where L intersects A (in p = q n =the origin), implying that m n is the zerovector. Proposition 2. Assume the previous notations and assumptions, in particular the origin is located at p ∈ A, and assume that L does not intersect A. Then the laser reflections R(n) corresponding to different positions M(n) of the rotating mirror share Proof. Due to our choice of the origin, q belongs to D 0 , where it is orthogonal to r ⊥ n . Recall that R(n) is oriented by r n conform to the sense of the reflection, and that the mirror axis A is orientated by r A such that ρ = r n · r A = −r L · r A > 0. Notice that in case the skew oriented lines A and R(n) cross "positively", which means that the undercrossing line passes the overcrossing from left to right, r ⊥ n is obtained by a clockwise quarter turn from in q n in D 0 as viewed from r A . Also note that for each mirror position M(n) the crossing sign of R(n) relative to A is the same, namely the opposite of the crossing sign of L and A.
So, due to the right-hand-rule for the orientation of the cross product m n = q n ×r n , and because r n · r A > 0, we see that µ = m n · r A < 0 if and only if R(n) crosses A positively. Because both r n ⊥ q n and m n ⊥ q n the projections m ⊥ n and r ⊥ n are aligned in D 0 . So, m ⊥ n = kr ⊥ n , where k > 0 if and only if µ < 0. We conclude that the sign of the moment pitch is the same for every laser reflection R(n).
Proposition 2 immediately implies (the left of Figure 3): Corollary 2. If the origin is chosen to be the point on the mirror axis A that is closest to the skewly incoming laser beam L, and if we denote the Plücker coordinates of two laser reflections by π(R(n 1 )) = (r 1 , m 1 ) and π(R(n 2 )) = (r 2 , m 2 ) then as oriented angles (viewed from r A ). The relative angles of the shown points are the same for each of the three circles. They represent the laser reflections R(n i ) = (r i , m i ) by their projected directions r ⊥ i (norm 1 − ρ 2 ), by their throat points q i (throat radius σ 0 ), and by their projected moments m ⊥ i (norm σ 0 ρ). Right: Four points with the same relative angles as in the left diagram, prepared for Theorem 3. If M = tB + (1 − t)C then t parametrizes the affine combination of (A, B, C) that yields D.

Affine combination of cocircular points
Using the assumptions and notations of Section 3, we have shown that for different mirror positions M(n 1 ), M(n 2 ), M(n 3 ), . . . we can consider three circles in the plane D 0 , centered at the origin (the left of Figure 3): • containing the points q 1 , q 2 , q 3 , . . . • containing the direction projections r ⊥ 1 , r ⊥ 2 , r ⊥ 3 , . . . • containing the moment projections m ⊥ 1 , m ⊥ 2 , m ⊥ 3 , . . . Furthermore, on each circle we observe identical oriented angles between points that correspond to the same laser reflections R(n i ) and R(n j ), which is determined by the (rotation) angle between n i and n j (by factor 2). As we will see, this implies that we can use the same affine combinations for all these circles. In the next section we will prove that these affine combinations on the circle can moreover be copy pasted to the Plücker coordinates of the reflected lines.
Let A, B, C be three non-collinear points in some plane, then we can uniquely express each point D in the (this) plane as an affine combination of A, B, C: Because z = 1 − x − y we count 2 dof for these combinations, which meets the number of dimensions of the plane. Notice that A, B, C determine a circumscribing circle C. Now we will restrict ourselves in generating only points D on this circle C, leaving us with only 1 dof for the coefficients (x, y, z). In this section we will express these coefficients as rational functions in a parameter that is explicitly determined by the relative angles between A, B, C, D.
The fundamental idea leading to our formulas is to parametrize the affine coefficients by the location of the point of intersection M of the lines AD and BC (the right of Figure 3). Theorem 3. Let a = |BC|, b = |AC| and c = |AB| denote the edges of the triangle ABC, and let D = xA + yB + zC be a point on the circumscribing circle C of this triangle, with x + y + z = 1. where Proof: It can be proven that the necessary and sufficient condition on the barycentric coordinates (x, y, z) for D to lie on the circumcircle C is given by (Fact 4 in Volenec (2004)): Eliminating M and solving for D we obtain: Since the sum of these coefficients equals 1, they must be equal to the barycentric coordinates (x, y, z), expressed in function of t and s. Substituting the barycentric coordinates of D as given by Eqn. 7 in the circle condition of Eqn. 6, we can solve for s: Finally, substituting this expression for s in Eqn. 7 yields the aimed claimed formula in Eqn. 6.
Observe that we do not lose generality by assuming that C equals the unit circle. Indeed, the affine coefficients remain invariant under scaling and translations: Furthermore, it can be easily seen that this affine combination is also not affected by rotations, such that we can choose A = (1, 0). Consequently, the computation of the coefficients (x, y, z) in Eqn. 4 only depends on the relative angles between the points.

Affine combination of reflected lines of a single laser by a rotating mirror
Consider four laser reflections R(n i ) by four mirror positions M(n i ) (i = 1, . . . , 4). From Theorem 1 in Section 2 we know that the lines R(n i ) belong to a ruled surface of revolution, a one-sheeted hyperboloid in general, or one of its degenerations in singular cases. If π(R(n i )) = (r i , m i ) denote the Plücker coordinates, and if r ⊥ i denote the projections of r i on D 0 , then the relative angle of revolution between R(n i ) and R(n j ) can be written as Theorem 4. Let us represent the rotation angles of four laser reflections by points P 1 , . . . , P 4 on a (unit) circle, that is, the arc between P i and P j equals θ ij . Then, the affine combination P 4 = x 1 P 1 + x 2 P 2 + x 3 P 3 (with x 1 + x 2 + x 3 = 1) also applies to the Plücker coordinates of the reflected lines: π(R(n 4 )) = x 1 π(R(n 1 )) + x 2 π(R(n 2 )) + x 3 π(R(n 3 )).
Proof. Let us first assume the origin at the centre p of the H(L, A), which is a hyperboloid in general, or a cone in case L intersects A. For now, we exclude the degenerate case where L intersects A perpendicularly, implying that all reflections belong to the same plane. In Corollary 2 it is stated that the relative angles of the projected moments of the reflected lines R(n i )) are identical to the relative angles of revolution (Section 3): So, Furthermore, π(R(n i )) = (r ⊥ i + ρr A , m ⊥ i + µr A ). Using x + y + z = 1: xπ(R(n 1 )) + y(π(R(n 2 )) + zπ(R(n 3 )) = In case L intersects A perpendicularly, things become more simple. Then, the reflected lines belong to a flat pencil, all assumed to intersect in the origin. In this case, π(R(n i )) = (r ⊥ i + ρr A , 0, 0, 0), and hence the previous argument still holds, restricted to the first three Plücker coordinates.
Next, we drop the assumption about the location of the origin in 3-space. The general situation can be transformed to the special situation (as described above) by a translation, which is a linear transformation T 4 of P 3 (represented by a 4 × 4 matrix). One can prove that this induces a linear transformation T 6 for the line coordinates π(L) (represented by a 6 × 6 matrix) Pottmann and Wallner (2001). The proof now is finished by the fact that linear transformations preserve affine combinations.

Data-driven calibration of rotating laser reflections
The previous explanation enables to predict a laser reflection by a rotating mirror M(n)), once three line reflections are known for three mirror positions. Notice that we bypass the geometry of the incoming laser beam L relative to the mirror axis A, neither do we need the spatial position of the mirror plane that corresponds to an (initial) angle. Notice that the described procedure equally well applies to devices with rotating lasers instead of rotating mirrors.
The algorithm: 1. Transform the mirror positions to rotation angles of the reflected lines: 2. Compute T and N as stated in Theorem 3 (Eqn. 5). This can be done by representing the three base angles and the fourth query angle on a (unit) circle, or directly in terms of cos(θ ij ) and sin(θ ij )). 3. Compute parameter t. Combine t, T and N to obtain the affine coefficients x, y, z (Eqn. 4). 4. Return π(R(n 4 )) = xπ(R(n 1 )) + yπ(R(n 2 )) + zπ(R(n 3 )).

Algorithmic details:
• When this algorithm is applied in a real world situation, we assume only small deviations from the mathematical conditions: the laser beam is always kept fixed, the rotation axis for the mirror is always kept fixed, the mirror shape is close to a plane, the mirror reflection is close to perfect (hardly damaged by scratches and holes). • The first step of the algorithm may be more involved in certain practical situations.
Indeed, the control of the rotating mirror is done by user parameters ω i that are not necessarily equal to the geometric angles between the n i . For instance, the mirror rotation might be galvanic driven, requiring input control in volts. The transformation from voltages to geometric angles might or might not be linear. Even if the user is allowed to use angular values for the input parameters, they are not necessarily identical to the geometric angles due to system noise. In this case, we obtain the angles directly from the measured reflection lines: θ ij = r ⊥ i , r ⊥ j . The transformation ω ij = ω i − ω j → θ ij can be obtained by analytic or probabilistic interpolation.
• For the computation of the parameter t it is recommended to permute {A, B, C} in Theorem 3 if needed, such that the chords AD and BC intersect inside the circle: M = AD ∩ BC = tB + (1 − t)C. This guarantees that t ∈ [0, 1] and significantly improves the stability.

The 3 by 3 line grid calibration of a 2M-GLS
This section is motivated by a galvanometer , a sensor consisting of a single fixed laser L that is internally reflected by two sequential mirrors, each rotating about an individual axis, denoted by A and B in order of reflection. The control of the individual rotating mirrors is typically galvano-driven, allowing two independent user parameters, denoted by α and β respectively ( Figure 2). As explained in Section 6, we may assume that we can express mirror angles in radians. Assume for the moment that we fix the second mirror at angle β 1 . By means of the algorithm of Section 6, we can predict an outgoing line R(α, β 1 ) by means of three observed lines R(α 1 , β 1 ), R(α 2 , β 1 ) and R(α 3 , β 1 ) corresponding to three positions of the first rotating mirror M(A, α): π(R(α, β 1 )) = x α π(R(α 1 , β 1 )) + y α π(R(α 2 , β 1 )) + z α π(R(α 3 , β 1 )), where the affine coefficients (x α , y α , z α ) are computed by Formula 4. Note that these coefficients do not depend on the specific choice β 1 for the position of the second mirror. Indeed, the relative angle θ ij between (R(α i , β 1 ) and (R(α j , β 1 ) is the opposite of the corresponding relative angle on H(L, A). More precisely, Theorem 5. A two-mirror galvanometric laser scanner is intrinsically calibrated by the knowledge of 3 × 3 emitted lasers R(α i , β j ) corresponding to a grid of 3 × 3 combinations of mirror pairs (α i , β j ) (i = 1, 2, 3 and j = 1, 2, 3). Proof. We show that for each given query pair (α, β), we can predict the corresponding double reflected laser R(α, β) by means of the given laser grid. To this end, we first compute the affine coefficients (x α , y α , z α ) for a fixed β j . In principle, the resulting coefficients are identical for each choice of β j (j = 1, 2, 3). Consequently, we obtain: π(R(α, β 1 )) = x α π(R(α 1 , β 1 )) + y α π(R(α 2 , β 1 )) + z α π(R(α 3 , β 1 )).

Experiments
In order to validate our hyperboloid grid model, we apply the method of Section 7 to synthetically generated data. The aim is to predict the set of Plücker coordinates for a given pair of mirror rotations. The benefit of working with synthetic data is that an exact underlying ground truth can be established. To this end, we built a setup in a virtual environment in the game engine Unity (version 2020.2.5f1). We placed two rotating mirrors and a laser in a configuration that can also be found in for instance a Polytec PSV-400 laser Doppler vibrometer (Figure 4). A real time demonstration of the setup in which the mirrors rotate to reflect an incoming laser beam can be seen in https://youtu.be/GNTjmJvdTpw. We generated laser beams for twelve rotation angles for the first mirror and sixteen for the second mirror, resulting in a 12 × 16 grid of 192 lines. To measure the Plücker coordinates of those (reflected) laser beams, we placed a detection plane in front of the setup and recorded where the laser beams intersect that plane. All reflections and the detection of intersections are handled by the builtin Unity physics engine. An overview of the virtual setup can be found in Figure 4. The reflected laser beams for a set of co-axial hyperboloids are visualised in detail in Figure 5. The detection plane is then moved and rotated in eight positions. The simulation scale is chosen such that the distances of the detection planes vary from approximately 1000 to 2600 millimetre.
Consequently, for each pair of mirror rotation angles (which uniquely generate a single laser beam), we obtain eight points. Strictly speaking, we only need to put the detection plane in two positions. However, to simulate real world conditions, we added Gaussian noise to the 3D coordinates of the detected points. We performed our simulations at seven noise levels with standard deviations equal to 0, 1, 2, 4, 6, 8 or 10 millimetres. For each of the noise levels, we generated 50 sets of lines. We average our findings over those 50 sets to eliminate statistical artefacts in the noise of the data. We perform a best fit method as described in Lesueur and Nozick (2014) to calculate the Plücker coordinates for the straight line generated by the mirror rotation pairs.
For each noise level we select a basegrid , being a subgrid of lines from the 12 × 16 dataset. We consider the following basegrid sizes: 3×3, 4×4, 6×6, 8×8 and 8×11. This allows us to investigate the influence of the number of training lines on the accuracy of the calibration. To avoid unnecessary numerical problems, the angles in these subgrids are (uniformly) spread out in the range of the rotation angles of the sensor mirrors. The angle pairs of the data sets that do not participate in the basegrid provide a test set, for which we use the Unity-generated lasers with zero noise as ground truth. The aim now is to predict the lines in the test sets when only the two mirror rotation angles are given. The proposed method uses the base grid to recover the two-mirror congruence as a double system of hyperboloids of revolution (Corollary 1). This line congruence is compactly represented as a 3 × 3 grid that enables laser predictions by means of affine grid combinations (Theorem 5).
A procedure for a robust fitting of a hyperboloid grid to a basegrid of noisy line measurements is described in Appendix A. Because the quality of this fitting has a significant share in the accuracy of our method, we present it here as an intermediate validation in the framework of the previously described synthetic experiment. The results are shown in Figure 6. The gain (noise reduction) is most apparent for grids ranging 6 × 6 and up.
We compare our method to the semi-data driven method described in Boi et al (2022), where the authors validate the performance and feasibility of semi-data driven approaches by means of Gaussian processes. The method of Boi et al (2022) outperforms current state-of-the-art physical-based calibrations, and performs at least equally well as other existing statistical or machine learning methods, which makes it an appropriate reference to compare our method with.
Following the procedure in Section D of Boi et al (2022), a Gaussian process is trained for each of the six components of the Plücker coordinates Rasmussen (2004). In the implementation of the Gaussian processes, we used a periodic kernel with 3x3 train 3x3 corr 4x4 train 4x4 corr 6x6 train 6x6 corr 8x8 train 8x8 corr 8x11 train 8x11 corr 1 6 10 1 6 10 1 6 10 1 6 10 1 6 10 1 6 10 1 6 10 1 6 10 1 6 10 1  Fig. 6 The means of the line segment errors with respect to the ground truth, for the measured lines as well as for the corrected lines (by hyperboloid grid fitting). The boxplots are grouped by five grid sizes and within each group ordered by three noise levels during the measurement of the 8 points (at a distance of at most 3 m) that are used for the line measurements: standard deviations of 1, 6 and 10 mm.
automatic relevance determination as suggested by Boi et al (2022): In order to evaluate the prediction quality of any method, we need a measure for the difference between two spatial lines. In our experiments we worked with several distance measures, but they appeared to agree with respect to the final conclusions. In the presentation of our results, we use the line distance measure as suggested by Pottmann and Wallner (2001). For the computation of this measure, we need to define two fixed parallel planes, with the certitude to limit our region of interest. As a matter of fact, we chose them perpendicular to the Z-axis (more or less the direction of the outgoing beams), one through the origin, the other at a distance of 10 metres. Two lines intersect these two planes in four points g 1 , g 2 , h 1 and h 2 (same indices for the same line, some letters for the same plane). We calculate the so called line segment distance d as follows: The line segment distance is computed to evaluate the error of each predicted line with respect to its ground truth. We took the average for all the lines per test set. This results in 50 averages per combination of grid size and noise level. This is done for the proposed method as well as for the GP-method. An overview of the results can be found in Figure 7 and in Figure 8. Note that the line segments that we used in our error measure have a length of at least 10 metre, which should be taken into account in the interpretation of the prediction error on the vertical axis of the figures (expressed in metre) For example, an lsd-error of 0.1 m for a predicted line is a line segment deviation of at most 1 cm per metre. means line segment distances between predictions and ground truth our method Fig. 7 The means of the line segment distances between the predicted test lines (by the proposed method) and the ground truth. The boxplots are grouped by five grid sizes and within each group ordered by seven noise levels during the measurement of the 8 points (at a distance of at most 3 m) that are used for line fitting: standard deviations of 0, 1, 2, 4, 6, 8 and 10 mm.
The runs with zero noise confirm that the proposed hyperboloid grid calibration is an exact method, even when using a minimal 3 × 3 grid. We also notice that for a measurement noise expressed by a standard deviation of σ mm (within a work space of 2 to 3 m), the line prediction error appears to be lower than 2σ mm (per metre) assuming a basegrid size of at least 4 × 4, and even bounded by σ mm (per metre) if we use basegrids of size 6 × 6 or larger. From our experiments there seems to be no convincing motivation to use basegrid sizes larger than 8 × 8. On the other hand, we observe that boxes are stretched out (between first and third quartiles) in cases where point measurements suffer from large noise levels (σ > 7 mm within the workspace region). This is explained by the fact that the basegrid data is corrected and fixed by a hyperboloid grid fit, such that the prediction errors for every test line are determined by the quality of this fit (Appendix A), which can be an unlucky estimate if the data noise happens to be unfortunate.
If we investigate the results of the GP-method for the same Unity-data (Figure 8), then we observe that 3 × 3 grids are too small to teach a useful Gaussian process. Its performance takes over the proposed method from the moment the GP is trained by basegrids larger than 8 × 8. In case of larger measurement noise, the variance of the GP results appears to be smaller than for the proposed method. This is due to the fact that a Gaussian process keeps on balancing the measurement noise during the prediction of the test lines. means line segment distances between predictions and ground truth GP method Fig. 8 The means of the line segment distances between the predicted test lines (using a GP) and the ground truth. The boxplots are grouped by five grid sizes and within each group ordered by the seven noise levels. For the minimal training set (3 × 3), the GP-model predicts values so far from the ground truth that they are no longer of any significance. The data has become to sparse to work with.
The datasets generated and analysed during the current study are publicly available in the github repository https://github.com/IvanDeBoi/Line-Calculus-on-Hyperboloids.

Conclusions and further research
This paper offered a completely new method for the modeling and 3D calibration of a galvanometric laser scanner with two mirrors. As a matter of fact, the proposed calibration paradigm applies to any laser scanner with rotational symmetry, such as other galvanometric systems or a Lidar, sensors with a rapidly growing number of applications. Our study provides a deeper understanding how many sensors can be naturally represented as a specific line variety, and how it pays off to discover the type of this variety by a mathematical analysis. The proposed line model is more specific than previously published general line models, but the calibration merely consists of measured line data, and does not need to recover intrinsic parameters of a physical model.
As a main contribution we model a two-mirror-GLS as a hyperboloid grid congruence that can be represented in a compressed way by a 3 × 3 basegrid of data lines. This is a significant simplification compared to the use of lookup tables commonly used in the 2D or 3D calibration of a GLS. We derived a formula that translates angular control parameters into simple affine combinations of these 3 × 3 grid lines, enabling our calibration model to make fast predictions.
In a follow-up article we describe how this formula allows us to find an analytic solution for the reverse engineering problem: how to determine the pair of mirror angles that generate the laser reflection that hits a given 3D target point. The hyperboloid grid model for a two-mirror galvanometric laser scanner and the affine combination formula for the 3 × 3 grid is an interesting theoretical result, but in order to validate its practical performance, and in order to compare it to a statistical training model (GP-method), we chose to fit a hyperboloid grid on larger training grids. To this end, we designed a new algorithm for the robust fitting of a hyperboloid of revolution on given rulers. As it is the case for every regression model, this choice implies the advantage of noise reduction, but the disadvantage of neglecting noise. Fitting on training grids of size at least 6 × 6 causes line prediction errors that are comparable or smaller than the point measure errors.
The results of the GP-method are inferior to the proposed methods for small grid sizes and for limited point measure noise levels. If the noise level is represented by a standard deviation of 8 mm or more (in the work space region up to 3 m), and if a basegrid is used of size at least 8 × 8, the GP-method performs more accurately and more precisely. This is due to the fact that a Gaussian process can be seen as a universal smoother, excellent at filtering out noise. On the other hand, the GP-method trains 6 separate line coordinates, and most often they do not satisfy the Grassmann-Plücker relation. Consequently, it fails to deliver an effective line. This can be taken care of by post-corrections, or by using a GP with manifold constraints, but it is an additional complication. In Boi et al (2022) it is shown that the violation of the Grassmann-Plücker relation becomes less apparent when using larger training sets.
Also, if the mirror quality of a real galvanometric laser scanner significantly deviates from our ideal mathematical assumptions, the GP-predictions will be more accurate than the idealised hyperboloid grid predictions. On the other hand, discrepancies between the ideal predictions of our method and an observed laser from the real world sensor can detect defects or flaws in the device. This suggests that our line model can also be applied as a tool for quality control.
Appendix A Fitting a one-sheeted hyperboloid of revolution to given noisy rulers Examples of approximation methods for ruled surfaces are presented in Pottmann and Randrup (1998);Hofer et al (2005); Pottmann and Wallner (1999). However, in these approaches, the ruled surfaces are fitted to given point data, rather than to measured lines, as is the case in our situation. Let L = {L 1 , L 2 , . . . , L n } be the noisy data lines that are supposed to be rotated images of some (unknown) line around some (unknown) axis A. We assume that the l i are presented by their normalised Plücker coordinates: L i = (r i , m i ).
Step 1: Considered as points, the correct normalised directions r i belong to a circle centred at a point x ∈ A, in a plane D x perpendicular to A. So, the direction vector r A of A can be recovered as the normal of a fitting plane. This plane D x can be approximated by a robust technique such as RANSAC or MLESAC Fischler and Bolles (1981b); Torr and Zisserman (2000). Observe that at this stage we only need to recover the normal r A of D x . In Section 7 we have measurements of rulers of several hyperboloids H(L(α), B) at our disposal, all sharing the same axis A of revolution, enabling us to increase the accuracy of the direction of this axis by computing the median or a trimmed mean of the computed r A of the individual hyperboloids (||r A || = 1). It is an option to neglect from now on data lines L i of which the directions r i have been considered as outliers in the previous step.
Step 2: Once we have found a reliable r A , we can recover the pitch ρ of the hyperboloid as the mean of the dot products r i · r A . We ensure that the directions are oriented such that all these dot products have positive signs. In this way, we can reduce the noise on the axial component r i = (r i · r A )r A of the line directions r i : Step 3: We can also "correct" the rotational components r ⊥ i = r i − r i , provided that we know the relative angles θ ij between each pair, what we normally do in case of a reliable control of the involved galvanometric device. We proceed as follows. Based on the measured data, and the previously recovered axis direction r A , we can consider the noisy projections r ⊥ i = r i −(r i ·r A )r A . The norms ||r ⊥ i || will be all corrected as 1 − ρ 2 , so we can focus on their directions d i = r ⊥ i /||r ⊥ i ||, points on the unit circle in the plane D o perpendicular to r A . We can represent them by a radian parameter pr i . The direction noise of the projections r ⊥ i is reduced by solving a constrained optimization problem in n unknowns cpr i , representing the corrected radian parameters pr i . More precisely, we minimise the sum of squared distances between cpr i and the noisy pr i , constrained by the given relative angles θ ij . Actually, a closed form solution for the cpr i is obtained by means of Lagrange multipliers. Finally, we map the cpr i back to unit vectors cd i in the plane perpendicular to r A , The correction of the noisy directions r i of the data lines is done as follows: (A2) Step 4: Having a reliable direction r A at our disposal also facilitates the recovery of the complete axis A = (r A , m A ). To this end, we lean on the property that the exact normalised rulers EL = (er, em) of the same regulus of a ruled surface of revolution have a constant bilinear product with the exact normalized axis EA = (er A , em A ), given by Pottmann and Wallner (2001) Ω(EL, EA) = er · em A + em · er A .
This motivates us to find the corrected m A as a Least-Squared Approximation for the equations augmented with the Grassmann-Plücker relation for the line A: r A · m A = 0, which might be multiplied by a weight factor if one needs to increase the importance to deliver a real line A. All these equations are linear, because we assume that r A is known. In composing this overdetermined system of equations, we use the noisy data (r i , m i ) of the measured inliers L i , and the recovered direction r A . Notice that we really need to obtain r A in a previous step, because the equations Ω(L i , A) − Ω(L j , A) = 0 are not sufficient to determine A. For example, rulers R in the second regulus of the same hyperboloid satisfy Ω(EL, R) = 0 for each ruler EL of the first regulus. Because a set of three rulers {L 1 , L 2 , L 3 } can serve for a minimal solver that recovers the moment m A of A, we encounter here another opportunity to integrate a robust consensus procedure by random sampling, now eliminating rulers L i with moment ouliers. Furthermore, to avoid numerical instabilities, we recommend selecting the pairs {L i , L j } for the equations Ω(L i , A) − Ω(L j , A) = 0 such that we maximize ||r i − r j ||.
Step 5: Next, for each of the data lines L i , we can compute its (perpendicular) distance σ i to the recovered axis A, and its closest point p i on A. Without noise, all these points p i coincide with the centre p of the gorge circle of the hyperboloid, and all these distances σ i are equal to its radius σ. So, we recover p and σ as the means of the p i and the σ i respectively. In Section 7 we have measurements of rulers of several hyperboloids H(L(α), B) at our disposal, all sharing the same axis, enabling us to apply the previous steps for each of them, yielding a gorge centre on the recovered axes of these hyperboloids. The mean of these gorge centres provides a stable point p s on the common axis, that gives rise to a more accurate computation for the moment as m A = p s × r A .
In any case, we use the reconstructed axis A to approximate the centre p and the radius σ of the gorge circle C p , enabling us to recover the gorge points of the exact rulers EL i : q i = C p ∩ EL i . Indeed, the directions pq i are exactly the quarter turns of the corrected projected directions cd i (Proposition 1), which together with the condition ||pq i || = σ determines the location of q i .
Step 6: Finally, we correct the moments m i of L i by q i × r i , where we use the corrected r i .