<<

Computa & tio d n e a li Brezov, J Appl Computat Math 2018, 7:3 l

p M p a Journal of

A

t

h DOI: 10.4172/2168-9679.1000410 f

e

o

m l

a

a

n

t

r

ISSN: 2168-9679i c

u

s

o J Applied & Computational Mathematics

Research Article Open Access Optimization and Lock Control via Shifted Decomposition of Brezov D* Department of Mathematics, University of Architecture, Civil Engineering and Geodesy, Hristo Smirnenski, Bulgaria

Abstract The present paper studies the effects of introducing a fourth in the generalized Euler factorization. As a first immediate consequence, it is shown to weaken the well-known Davenport orthogonally condition on the decomposition axes, thus allowing much more freedom in the geometry of mechanisms. Furthermore, the additional parameter is used for avoiding gimbal lock singularities and optimization purposes. Some of these features have been pointed out by other authors and partially studied in the case of two axes. This text, however, provides exact closed form solutions based on recent results on the generalized Euler decomposition problem. The examples considered below clearly illustrate that the approach of four factor sequences can be significantly more efficient than standard Euler type decompositions. Finally, dynamical effects, such as the inertial anisotropy, are being modelled via introducing weight coefficients in the cost function.

Keywords: Rotations; Spacecraft attitude; Robot kinematics; of attitude maneuvers. Here we consider only minimization of the Optimal control rotation path, while the impact of specific asymmetries is being modelled by introducing weights in the cost function. A more detailed Introduction discussion from dynamical perspective [9,10]. have been a major tool in the description of attitude Vector Decompositions of Rotations orientation of spacecraft and aircraft since these technologies exist. ζ The vector-parameter may be introduced as c= where the unit However, the method causes some troubles, such as the so-called ζ 0 gimbal lock problem related to the inevitable topological singularity 22 2 of the parameterization map between the three-dimensional torus and ζ=( ζ0,ζ) =+ ζζ 01i + ζ 2 j+ ζ 3 k ∈ ,|| ζ|| =+= ζζ0 1 3 the rotation group in  which has the topology of projective space is a representative of the spin group SU(2) 3, so c actually inhibits 3 3  ← SO(3). This problem does not appear if we use or 3   the projective space SO(3)  . Note that it may also be expressed axis-angle decomposition [1] associated with the Hopf bration , but φ 1 via the Euler’s trigonometric substitution as≅ c=τn where τ =tan ∈� ≅ 2 in practice this may be even less efficient in terms of attitude adjustment. is usually referred to as the≅ scalar parameter (ϕ being the angle of It has been [2] the gimbal lock singularity may be utilized within the 2 rotation) and n  stands for the unit vector along the invariant axis. Euler angles' framework using a simple optimization procedure on This parameterization provides several major advantages. Firstly, it the excessive free parameter at the singular point. The present paper allows for expressing∊ the rotation entries as rational functions suggests an analogous procedure in the regular case as well, by means of c, namely of introducing a fourth “shift" parameter. Such an additional degree of 2 t × × (1−c) I ++ 22 cc c I + c R (c) = = (1) freedom allows for optimizing and thus, saving a significant portion 1+−cc2 I × of the energy spent on spacecraft maneuvers as well as manipulating where  stands for the identity, cct denotes the tensor (dyadic) the gimbal lock condition. A similar idea for optimization [3,4] for product and c× is an extension of the Hodge duality that de nes the sequences of arbitrary length in the two-axes setting. Here we allow three 3 cross product in  as a×b=a×b. As the right-hand side in eqn. (1) is axes while restricting to four factors, which turns out to be sufficient in the well-known Cayley map, we have (c)=Cay(c×). many cases [5]. Hence, the cost function may be expressed explicitly in terms of α, due to the closed form solutions obtained below. The Another advantage is the compact form of the group composition derivation of these results is based on a recent study on the generalized law cccc2++× 1 21 Euler decomposition problem [6] considering arbitrarily oriented axes cc21,,= ⇔=RR(c2) ( c 1) R cc 21 1− (cc) (2) and the corresponding necessary and sufficient condition [7]. In this 21 3 1 where (ab; ) = a⋅ bstands for the scalar (dot) product in  . Note extended framework we may weaken the Davenport condition γ12+γ23

≥ π for the relative angles between the axes [8] to γ12+γ23+γ31 ≥ π, thus allowing for different geometries of attitude control mechanisms in vehicles and robots, beyond the classical orthogonal settings. The text *Corresponding author: Brezov D, Department of Mathematics, University of Architecture, Civil Engineering and Geodesy, Hristo Smirnenski, Bulgaria, Tel:+359 is organized as follows: in the following section the quaternion based 2 963 5245; E-mail: [email protected] vector-parameter is introduced and utilized to solve the generalized three-axes decomposition problem. Section three explains in detail Received July 10, 2018; Accepted August 07, 2018; Published August 09, 2018 the shift parameter construction, while sections four and five focus on Citation: Brezov D (2018) Optimization and Gimbal Lock Control via Shifted its applications in gimbal lock control and optimization of rotational Decomposition of Rotations. J Appl Computat Math 7: 410. doi: 10.4172/2168- 9679.1000410 sequences, respectively. Several examples are given to illustrate the way variations of the shift parameter influence the energy efficiency Copyright: © 2018 Brezov D. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted 1 Here γij denotes the minimal angle between the rotation axes, so orthogonally is use, distribution, and reproduction in any medium, provided the original author and implied source are credited.

J Appl Computat Math, an open access journal Volume 7 • Issue 3 • 1000410 ISSN: 2168-9679 Citation: Brezov D (2018) Optimization and Gimbal Lock Control via Shifted Decomposition of Rotations. J Appl Computat Math 7: 410. doi: 10.4172/2168-9679.1000410

Page 2 of 7 also that formula in eqn. (2) is just the quaternion multiplication rule decomposition. In the case eqn. (7) instead of eqn. (4) this procedure projected onto 3. Composing rotations in this manner appears far yields.  1 g γ more efficient in terms of computational complexity compared to the 12 31 ∆=′′gg10 ≥ (9) usual matrix multiplication [5]. 12 23 γ 31g 23′ 1 With the aid of formula in eqns. (1) and (2) one may derive [6] where we may express the α-dependent matrix entry as the explicit solutions to the generalized Euler decomposition problem g′′(α) ==++(ccˆˆ, ) gg g cosαω sin α =τ 23 2 3 12 13 1[1g2 ]3 2 (c)=(c3)(c2)(c1), where ci iicˆ stands for the vector-parameter φi 2 of the i-th rotation in the decomposition,τ i = tan , cˆ ∈ i.e., More 2 i  with the standard notation a[ibj]=aibj−ajbi. On the other hand, the precisely, we have condition in eqn. (9) may be written in the equivalent form [7].

± σ i τ= σε = −> γ 22 22 i ,,i ijk(g jk jk ) jk (3) ′ g12γ 31 −−−≤≤+−−(11 g12)( γγ 32) gg 23 12 31 (11 g12)( γ 31 ) ωi ±∆ where εijk denotes the Levi-Civita symbol. Furthermore, we make use Moreover, using a standard trigonometric substitution one may of the notation express

gij= (ccˆˆ i,,cc j) γ ij= ( ˆ i ,R (c) ˆj ) g23′ (α) = Acos( αα −+0) gg 12 13

as well as with t 2  ωi =×=×=(cˆ1 c,ˆR (c) cˆ3), ωω 2( cˆ 1cc ˆˆ 23 ,, c ) 3 ((c)cˆˆ12 ,c × ˆ 3) 2 ω2 Ag=( 1[ g ]3) +=ωα 2, 0 arctan 12 g 1[12 g ]3 and the necessary and sufficient condition for the existence of real solutions This allows for writing the above inequalities in the simpler form

1 g12γ 31 cos(γ12+− γ 31) gg 12 13 ≤ Acos(αα −≤0 ) cos( γ12 −− γ 31) gg 12 13 ∆=gg2110 23 ≥ (4)

γ 31g 32 1 where we make use of the notation

γij =arccosgij = (ccˆˆ i , j) ,γγ ij = arccosij = (cˆ i , cˆ j ) Whenever any of the conditions γji=gji (i≠j) holds, one may decompose into a pair of rotations about the i-th and the j-th axis as Note that since we have the restriction |cos(α−α )|≤1, formula ()c= (ττ , ccˆˆ )  ( ) 0 j j ii with eqn. (15) determines a real interval for the shift angle α for arbitrary γ − jj 1 γ ii −1 compound rotation if and only if ττij=οο, = (5) ωωij cos(γγ12−−≥−+−≤ 31) gg 12 13 A, cos(γγ12 31) gg 12 13 A ο ο t ωi =ccˆˆ × , (c)c ˆ ωi =(c)ccˆˆ, ×c ˆ where the notation ( ijj ) and ( ii j) is used. With On the other hand, one has i=1,j=2 in particular, these expressions apply also to the gimbal lock ω 2=det{g } ⇒= A 1 −gg22 1 − setting 2 ij ( 12)( 13 )

ccˆˆ3 =±⇔± 1γ 31 1 (6) so the above conditions may be written also as

cos(γγ12−≥ 31 ) cos( γγ12 + 31 ) in which the first equality in eqn. (5) yields the scalar parameter of ϕ1 (10) cos(γγ12+≤ 31 ) cos( γγ12 − 31 ) ± ϕ3.[2,6]. which finally yields for the unknown parameter2 The Shift Parameter Construction γγ12− 13 −≤≤ γγ 12 312 γγ 12 + 13 (11) Let us consider a specific type of decompositions involving four rotations about three initially given axes. Namely, we rotate twice The interval determined in this way is typically larger compared to about one of the axes introducing an additional parameter in one of γγ12− 23 ≤≤+ γγγ 31 12 23 (12) the following ways that guarantees decomposition into three consecutive rotations about = (ψ) (α) (υ) (φ);= (α) (ψ) (υ) (φ) ˆ 3 1 2 1 2 3 2 1 the ci 's [7]. In particular, for γ12=γ13=γ the lower bound in eqn. (11) is γγ≤ where subscripts label the invariant rotation axes used in the trivial and we end up with 31 3 . Moreover, one obviously has (the γ ⊥ ˆ factorization and Greek letters denote the corresponding angles. With extremal values of 31 correspond to nc1,3 ) the aid of group conjugation it is straight-forward to [2] that γ31 −≤≤+|| φγ31 γ 31 || φ (13) = (ψα) ( ) ( ϑϕ) ( ) = ( ψ) ′ ( ϑϕα) ( + ) γπ∈ 3 1 21 3 21 (7) and since 31 [0, ] the case γγ13≤ 2 12 also yields a trivial lower ′ where 2 stands for a rotation about the axis ccˆˆ′2 = 1 (α ) 2 . This bound in eqn. (11). Hence, the sufficient condition for the compound technique allows also for the second decomposition above to be written rotation's angle is in a quite similar form as |φ|≤2γ12 (14) ′ = 2321(α) ( ψ) ( ϑ) ( ϕ) =  32( ψ) ( ϕα+ )  1( ϑ) (8) Note that as long as (11) holds, one may choose an arbitrary ′ With ccˆˆ3 = 2 (α ) 3 Thus, both cases may effectively be reduced to α [α0+arcos χ−, α0+arcos χ+] (15) decompositions into three factors with one of the axes “shifted” by an The endpoints of the interval in eqn. (15), for example, yield ∆′=0 α-rotation. ∈ π 2 γ ∈ We may always assume for two of the relative angles ij 0, , while 2 The next step is to use the additional fourth parameter to guarantee .  γπij ∈[0, ] the necessary and sufficient condition eqn. (4) for the corresponding

J Appl Computat Math, an open access journal Volume 7 • Issue 3 • 1000410 ISSN: 2168-9679 Citation: Brezov D (2018) Optimization and Gimbal Lock Control via Shifted Decomposition of Rotations. J Appl Computat Math 7: 410. doi: 10.4172/2168-9679.1000410

Page 3 of 7

and hence, rational expressions for the τk's. More generally, using the In particular, in the symmetric case γ12=γ23=γone has γγ21 ≤ 3 ′ ′ quantities (otherwise gij =gij and rij =rij ) while for r21=±1, the interval in eqn. (15) for α is either empty, γ≤ γ γπγ ≥− or there is no restriction, the condition being 1222 23or 12 23 g′′= (ccˆˆ,,) γγ ′′= ( cˆ , cˆ) , ′= ( cˆ , cˆ ′) 23 2 3 21 2 1 32 3 2 depending on the sign. Now, if in eqn. (18) holds and A ≠ 0 , one may as well as choose arbitrary α in eqn. (15), where ′ ′t ′ ′′ ′ ±−= 1 γγ ±− γ  ω1=×=×=×(ccˆˆ 12, cˆ 3) , ωω 2( cccˆˆˆ 1233 ,,) ( cccˆˆˆ 123 , )  A Cos( 12 23) g 23 31 gg′ = one obtains the explicit solutions with the aid of formula in eqn. and calculate (for all other values of i and j we have ij ij γγ′ = (3) in the form respectively ij ij ) σ ′ ′= ˆˆ ′′γγ ′= ˆˆ ′ ′ ′= ˆˆ ′ ± i ′ ′′ g31( cc 3,, 1) 32( cc 3 ,RR 2) , 31( cc 3 , 1 ) τi =,, σεi =−> ijk(g jk γ jk ) jk (16) ω′′+∆ t i ′ ′ ′ ′′ ′ ω1=×=×=×(ccˆˆ 12,RR c ˆ 3) , ωω 2( ccc ˆˆˆ 123 ,,) 3( ccc ˆˆˆ 123 ,) which gives for the remaining three rotation angles in the in order to obtain the solutions based in eqn. (3) in the form decomposition ± σ i′ ±±±±±± τi =,, σεi′ = ijk(g ′′ jk −> γ jk ) jk ′′ (20) ϕ=2arctan τ1 −= αϑ , 2arctan τ 23 , ψ = 2arctan τ ωi ±∆ cˆ which finally provides the remaining three rotation angles If, on the other hand, 1 is parallel to either ccˆˆ23or one cannot use as a shift parameter: in the former case one ends up with only two ±±±±±± ϕ=2arctan τ12 , ϑ = 2arctan τ −= αψ , 2arctan τ 3 factors that imposes a far more restrictive condition r =g and in the 31 31 Note also that the decomposition in eqn. (8) is, in some sense, dual latter, a decomposition of the type  =121 or =212 takes place. Note that formula in eqn. (14) is too restrictive as it always to in eqn. (7). Namely, using matrix transposition one easily shows that ensures such decompositions into three factors. The shift parameter, the former is equivalent to however, effectively weakens in eqn. (12) and may thus be utilized for t ′′ RR=13( −ϕ) R( − ψ) R 2( −− ϑα) (21) engineering purposes as already discussed above. ′′ Where R stands for a rotation about the unit vector ccˆˆ32′′ =R ( −ϑ) 3 Next, we consider in eqn. (8) with the discriminant condition so the shift angle in this case is ϑ . It is not hard to see that it is real as γ ′ 1 g12 31 long as ∆=′ gg10 ≥ 12 23 (17)  cos(γ23+ γ 21) −gg 12 23 ≤ Acos(ϑϑ −≤0 ) cos( γ23 − γ 21) −gg 12 23 γ 31′ g 23 1 where the matrix entry r′ is explicitly given in the form with 31 2 ω Ag = +=ω2 sin γ sin γϑ ,= arctan2 ( 12[ 23g ] ) 2 12 23 0 γ′ α=ccˆˆ ′′, =gg2 cosαω ++ sin α γ 31 ( ) ( 3 1 ) 21γ 3 23 21 g 3 and may be further 12[ 23g ] simplified as that leads to in eqn. (18). Then, if the latter holds and A ≠ 0 , we ′  γ31 ( α) =Agcos( αα −+0) 23 γ 21 choose arbitrary ϑ [ϑ +arcoss χ−, ϑ +arcoss χ+] (22) with 0 0 ±− 2  =A 1 Cos(γγ ±− ) g γ   ω where∈ 23 21 12 23 and calculate Ag +=ωα2 , arctan3 γ 30 2123  ′′= ′′ = ′′ = ˆˆ ′′  g γ g21 g 23,, g 31 g 12 g 32( cc 3 , 1 ) 21[ 23] γ′′= γγ, ′′ = (cˆ ′′ ,,RR c ˆ) γ ′′= ( cc ˆˆ , ′′ ) This yields the inequalities 31 21 32 3 1 21 2 3 ′′ ′′ ′′ ′′ ′′t ′′ ω1=×=×=×(cˆ 2 c ˆ 3,RR c ˆ 1) , ωω 2( c ˆ 1 cc ˆˆ 23 ,,) 3( cc ˆˆ 23 , c ˆ 1) γγγααγγγ+ − ≤ −≤ − − cos( 12 23) gA 23 21 cos( 0 ) cos( 12 23) g 23 21 ′′γ ′′ Finally, ∆′′ is obtained in eqn. (4) with gij and 31 replacing

which have real solutions for α as long as respectively gij and γ31. With the above data the solutions are expressed via formula in eqn. (3) as cos(γγγγγγ12+ 23) −gA 23 21 ≤,cos( 12 − 23) − g 23 21 ≥− A ± σ i′ τi =,, σεi′′ = ijk(g ′′ jk −> γ ′′ jk ) jk ω′±∆ ′′ (23) Moreover, taking into account that i and provide the remaining three rotation angles in the form 1 g23γ 21 2  22 ± ± ± ±± ± ωγ3=g 231 31 ⇒−− Ag( 1123)( γ 21 ) ϕ=2arctan τ32 , ψ=− 2arctan τα ,=−− ϑ 2arctan τ 1 γγ21 31 1 Let us also consider a third type of decompositions, namely we end up with the system

=(c)=1(α)3(ψ)2(ϑ)1(φ) (24) cos(γγ23−≥ 21 ) cos( γγ12 + 23 ) in which it is no longer possible to conjugate any of the factors. cos γγ+≤ cos γγ − ( 23 21 ) ( 12 23 ) However, one may work with the compound rotation instead, writing

that yields for γ21 the interval the above as  t R=R=( R1(α) c=) =R 3( ψ) R 21( ϑ) R( ϕα+ ) = γγ23−−≤≤ 12 γγ 23 212 γγ 23 + 12 (18) and with the aid of formula in eqn. (13), we obtain a condition for Similarly to the previous cases, we express the α-dependent ϕ in the form parameter γ′ ( α) =(RR( α)ccgˆˆ, ) =cosαω ++ sin αg γ 31 1 3 1 11[13γ ] 2 13 11 |ϕ|≤2γ23 (19)

with the notation ω2=(ccˆˆ 13 × ,R c ˆ 1) in the form

J Appl Computat Math, an open access journal Volume 7 • Issue 3 • 1000410 ISSN: 2168-9679 Citation: Brezov D (2018) Optimization and Gimbal Lock Control via Shifted Decomposition of Rotations. J Appl Computat Math 7: 410. doi: 10.4172/2168-9679.1000410

Page 4 of 7

 Theorem γ31′ ( α) =Agcos( αα −+0) 13 γ 11 where Given two or three distinct points on 2 connected by a three- segment spherical geodesic path (with possible repetitions) of length L 2 ω γ  2 2 Ag= +=ωα20, arctan ( 11[13g ] )  ≥ π, any SO(3) transformation is decomposable into four consecutive g11[ g ] 13 rotations, each fixing one of those points. Then, the necessary and sufficient condition 2 1 g γ ′ In particular, the vertices of any spherical triangle on  with 12 31 3 ∆=′ ≥ perimeter at least π determine the invariant axes in  for such a gg1210 23 (25) factorization. This triangle, however, may be degenerate, i.e., the points γ ′ g 1 31 23 are allowed to lie on the same big circle. Moreover, two of them may may be written for the shift angle α as coincide, in which case for instance γ12=γ23=γ and one has Lγ=3γ that  is an old result due to Lowenthal on the order of finite generation of cos(γγγααγγγ12+ 23) −gA 13 11 ≤cos( −≤0 ) cos( 12 − 23) −g 13 11 the orthogonal group in 3. Note that the above theorem allows in On the other hand, one has principle for generalization to longer factorization sequences, but in this study we are interested in the case of four factors. 1 g13γ 11 ωγ 2=g1 ⇒= Ag 11 −22 − γ 2 13 31 ( 13)( 11 ) Gimbal Lock Control γγ11 31 1 Since condition in eqn. (6) determines a zero measure set, the above so real solutions for α exist as long as construction may be used to avoid it as long as the interval for the shift cos(γγ13−≥ 11 ) cos( γγ12 + 23 ) parameter contains more than one point. On the other hand, to inflict gimbal lock on purpose using the shift parameter, one needs another cos(γγ13+≤ 11 ) cos( γγ12 − 23 ) nontrivial condition. Let us consider once more the decomposition in γ that yields for 11 the interval eqn. (8), written as a three-factor product. The gimbal lock condition yields for the shifted third axis γ23− γ 12 −≤≤ γ 13 γγγ 11 12 + 23 + γ 13 (26)

cˆ32′ =RR(α ) cc ˆˆ 3 = ± 1 Note that the lower bound is trivial since γ11 is defined as non- negative, while the expression on the left is non-positive due to which imposes the geometric restriction the triangle inequality. Then, the corresponding condition for the cˆ2 ∈ Span{ c ˆ3 ±RR c ˆˆ 1 , c 3 × c ˆ 1 }1 ⇔±( γγ31)( 21 g 23 ) =0 compound rotation’s angle reads The latter has the trivial solution α=0 for γ 31 = 1 (the gimbal φγ≤++ γ γ 12 23 13 (27) lock is already present without the shift) plus another one in the form γ = ±g which allows for a much larger class of configurations compared to 21 23 . The interval for α in those cases is non-empty as long the classical Davenport setting. Consider for example the Pyraminx, as the inequality γ12 ≤ 3γ13 holds for the positive sign and respectively γ ≤ π−3γ for the negative one. Note that in this setting we have in which the three axes are oriented along the edges of a proper 12 13  2 γ ′ = ±1 Ag=1 − 23 so the gimbal lock condition 31 yields cos(α-α0)=±1 tetrahedron. The existence of the decomposition =321 for γ≤ γ ⇒≤ φγ for the shift parameter, which has the solutions α=α0 and respectively, arbitrary  demands 31 2 while the restriction imposed by α=α -π. Thus, for the α-interval we have −χ ≥ 1 ≥ χ+ in the former case formula in eqn. (27) namely φ≤=3 γπ is trivial. In the generic case 0 and χ+≤−1 ≤ χ− in the latter, which has a solution only if γ =γ for one proceeds with the solution as follows: first, choose a value of α in 12 23 the positive sign and γ +γ =π for the negative one. Note that in the non-empty interval in eqn. (15), where3 12 23 both cases this allows for factorization into a pair of rotations, since ±−= 1 γγ ±− γ   A Cos( 12 23) g 13 11 one has =21  γ21=g21. In particular, in the Davenport setting 4 A = 1 αγ0=  31  tt g12=g23=0 one needs also γ21=0, which yields . and , so we and use it to obtain the shifted rotationR=R=c ( R11(αα) )= R( ) R( c) R ( α) may set γ31 =cos( αα −=±0 ) 1 and thus obtain for the shift parameters that is going to replace (c) in formula in eqn. (3). Then, calculate αγ= αγ= + π respectively + 31 and − 31 . Therefore, avoiding the above γα′= ′′= ij (cˆ11,,RR( cc) ˆˆj) c i ( ) c ˆi values guarantees avoiding gimbal lock even if γ21=0. Moreover, in this case both signs in eqn. (6) are possible since we have ccˆˆ= R (α ) With 1 i as well as π π α ∈+γγ′ − ++ γγ 31 12,  31 12 ′ ′t ′ ′ ′ ′′ ′ 2 2 ω1=(cˆ 1×==× c ˆ 2,,RR( cc) ˆ 3) ωω 2 2 , ω 3 ( (ccc) ˆˆ12 , c ˆ 3) One may approach the decomposition in eqn. (7) in a similar way. and thus express Note that the α-parameter only alters the middle axis, so it cannot affect σ ′ the gimbal lock. Actually, γ =±1 yields A=0 and in eqn. (10) is possible ± i ′′ 31 τi =,, σεi = ijk(g jk −> γ jk ) jk (28) only if g12=0 or g13=1. On the other hand, using matrix inversion, one ωi′′±∆ where ∆′ is given by formula in eqn. (25). Hence, one has for the may express in eqn. (7) in the form t remaining angles RR= ′−21( ϑ) R( −− ϕα) R 3( − ψ) (29) ±±±±±± ψ=2arctan τ , ϑ = 2arctan τ , ϕ =−− 2arctan τα ′ ′ 32 1where R 2 stands for a rotation about the unit vector ccˆˆ21=R ( −ϕ ) 2, so Taking into account in eqns. (11), (18) and (27) it is not hard to φ plays the role of a shift angle. The discriminant condition for this justify the following setting is 3We may always assume A ≠ 0 as the case A = 0 does not impose any restriction 4 ˆ on α. In this case the unit vector R c1 is confined to the plane spanned by cˆ3 and ccˆˆ23× .

J Appl Computat Math, an open access journal Volume 7 • Issue 3 • 1000410 ISSN: 2168-9679 Citation: Brezov D (2018) Optimization and Gimbal Lock Control via Shifted Decomposition of Rotations. J Appl Computat Math 7: 410. doi: 10.4172/2168-9679.1000410

Page 5 of 7

1 g13γ 32′ Finally, the gimbal lock condition in eqn. (24) may be written as ′ ∆=gg1310 12 ≥ (30) (1 ± γ31)(γ11 g31)=0 γ 32′ g 12 1 which yields, apart from the trivial solution α=0 at γ = 1, another Where ∓ 31 one in the form γ11= ± g31. Since γ′31= ± 1 in this case is equivalent to ′′ ∓ γ32 ( ϕ) =(ccˆˆ2, 3 ) =γcos ϕω ++1 sin ϕg12 γ 31 cos(α−α )= ± 1, one needs either γ =γ or γ +γ =π, respectively. In 31[ 21] 0 12 23 12 23 the Davenport setting for example, the corresponding values of α are

which may be written also as once more given byαγ+−=31 and αγ =31 − πwhile  cos(γγγϕϕγγγ12+ 13) −gA 12 31 ≤cos( −≤0 ) cos( 12 − 13) −g 12 31 α∈γγ31 +− γγ 12 23 , 31 + γγ12 + 23 . With Therefore, just as before, both signs in formula in eqn. (6) may 2 ω  γ+= ωϕ2 1 occur. A 31[ g ] 10, arctan ( 21 ) γ 31[ g ] 21 Allowing permutation of axes, we systemize the above results in Taking into account that the following

1 g12γ 31 2  22 Theorem ωγ1=g 12 132 ⇒= Ag( 11 −12)( − γ 31 )

γγ31 32 1 Avoiding gimbal lock via the shift parameter technique is always π possible as long as there are two distinct angles γ , whose sum is L ≥ . real solutions for φ are easily seen to be available as long as the ij ã 2 inequalities Inflicting it, however, may be done only in one of the two cases: γγγ−−≥ γγγ +−≤ cos( 12 13) gA 12 31 , cos( 12 13) gA 12 31 1. γij=gij= ± gjk=0 that yields a decomposition into two factors

hold, which leads to in eqn. (11). Thus, in the generic case γ12≠ 2. γii= ± gij and gik= ± gjk γ namely formula in eqn. (11) determines the resolution set and the 13 where the values of i; j and k are assumed to be different. condition for the compound rotation’s angle in eqn. (14). Then, for A ≠ 0 we set the value of ϕ in the interval Optimization φ [φ +arcoss χ−, φ +arcos χ+] (31) The additional fourth parameter introduced above (usually denoted 0 0 by α) may be used for optimization of rotational sequences as long as it where∈ is defined over a set of non-zero measure. One may naively suggest that ±− 1 the total minimum of the cost function  =A cos(γγ12 ±− 23) g 12 γ 13  and proceed as before calculating εϕγ =+++||||| ϑψ ||| α (33) g′= g,,, g ′ = g g ′′ = ( ccˆˆ) 21 13 32 12 31 2 3 is reached at α=0, but our numerical tests reveal quite a different ′ ′′tt ′′ γγγ21= 31, 31 = (ccˆˆ 2 ,,RR 3) γ 32= ( c ˆ 2 , c ˆ 1 ) picture. Consider for example the decomposition in eqn. (7) and cˆ ′ ′′ ′ ′t ′ let the unit vectors i be oriented along the coordinate axes (the ω1312=×=×=×(ccˆˆ,RR c ˆ) , ωω 21233( ccc ˆˆˆ ,,) ( ccc ˆˆˆ 312 , ) so-called Bryan setting). Then, we obviously have ijg =δij, where

Using these quantities one easily obtains the scalar parameters denotes the Kronecker symbol, and γij are simply the matrix entries cˆ2 σ ′ of  in the standard basis. Moreover, the α-shift of the vector ± i ′ ′′ τi =,, σεi = ijk(g jk −> γ jk ) jk (32) is obviously a rotation in the YOZ plane and may thus be written as ωi′′±∆ cˆ2′ =cosαα cc ˆˆ 23 + sin , which facilitates the calculation of the other where ∆′ is given by formula in eqn. (30) and for the remaining primed quantities we need, namely angles one has g32′′==+=+sinαγ ,21 γ 21 cos αγ31 sin αγ ,32′ γ 32 cos αγ33 sin α ψ±== ταϕ ±±−= τ± ϑ ±− τ± 2arctan1 , 2arctan 23 , 2arctan ω1′=−== γ 33 cos α γ32 sin α , ω2′′ cos αω ,3 γ 11 cos α The gimbal lock condition for this case may be expressed in the ∆=′ cos22αγ − ⇒ α ≤arscin 1 − γ2 form and finally 31 31 Substituting the above expressions in formula in eqn. (16) yields for the scalar

(1 ± γ32)(γ31 ± g12)=0 parameters

± γγ+−( 1) tan α αϕ+ which naturally yields α=0 for γ32=± 1 and the second solution is τ = 32 33 = tan 1 22 2 obviously γ31= ± g21. Identical arguments here show that in order to inflict γγ33− 32 tan α ±− 1 γ31 sec α gimbal lock one needs γ =g as well as either of the relations γ =γ (34) 31 31 12 13 ±±γ31 sec α ϑ γγ21+ 31 tan α ττ23=−==tan , and γ12+γ13=π for the two signs in formula in eqn. (6), respectively. In 22 2 22 1±− 1γα31 sec γ11 ±−1 γα31 sec both cases, however, a decomposition of the type (c)=3(ψ)1(φ) and the cost function may easily be obtained in the form is possible. For instance, in the setting g12=g13=0 one easily obtains ϕ+−= γ32 and ϕ = πγ + 32 the values of the shift parameter . Since the (α)=|α|+|2arctan τ −α|+|2arctan τ |+|2arctan τ |. admissible interval is γ 1 2 3 Moreover, the gimbal lock singularity in eqn. (6) persists for all ππ ∊ ϕ∈+− γγ ++ γγ values of α, but the condition in eqn. (9) demands α=0 or α=π, so we 32 31, 32 31 22 have a transfer of parameters α→ψ [−π,π] and minimize γ(ψ). Our we see that both possibilities for gimbal lock are present in this case. example is a rotation by an angle ϕ=−120° about the vector n (3,4,5) ∈ ∊ ∼ J Appl Computat Math, an open access journal Volume 7 • Issue 3 • 1000410 ISSN: 2168-9679 Citation: Brezov D (2018) Optimization and Gimbal Lock Control via Shifted Decomposition of Rotations. J Appl Computat Math 7: 410. doi: 10.4172/2168-9679.1000410

Page 6 of 7

° t. The minimum of the cost function γ(α0) ≈ 179.81 obtained at α0 ≈ energy consumption, or approximately 19.54% increase in efficiency 13.49° yields about 36.49% efficiency increase compared to the standard compared to the standard Euler decomposition. The two points of ° ∊ ° ° Bryan setting γ(0) ≈ 245.31 (Figure 1a) and the optimal sequence of discontinuity α1≈−143.13 and α2≈36.87 are related to the condition rotation angles is easily derived as γ 32=g 32, i.e., φ=0. The optimal sequence of rotation angles in this case ∊ ° ° ° ° has the form φ ≈−0.16 , ϑ ≈−75.14 , α ≈ 13.49 , ψ ≈−91.02 . ′ ′ φ ≈−52.24°, ϑ ≈−50.77°, ψ ≈−50.77°, α ≈−105.37° Another relatively simple setting is provided by the classical Euler ZXZ decomposition. Finally, considering the XY ZX setting in formula in eqn. (24) one easily finds We consider this time (8) with cˆˆ13 =c oriented along the 2 ˆ ˆ′ =ααˆˆ − γ32− γ 23 tan αγ +−( 33 γ 22 )tan α ϕα+ z-coordinate axis c2 aligned with OX. This yields c3 coseezy sin τ = = tan ± 1 2 ′′ which allows us to obtain the scalar parameters τ in the form γ33+ γ 22 tan αγ −+( 32 γ 23 )tan α ± sec α ∆ 2 i (36) γ− γ α ϕ−+ γ γ α ϑα+ γtan αγ−+ ϑ γ γtan α ψ ±±31 21 tan 133 23 tan ττ= 21 31 = = 21 31 = ττ12= =tan , = = tan 23tan , tan γγ−tan α ±∆′′22−tanα ±∆ secα±∆′′ 22γαsec ±∆′′ 32 22 (35) 11 γαsec ψ τ ± =−=13 2 2 3 tan with ∆′′=sec α − (γ -γ tanα) . Note that the condition γ =0 γγ+∆tan α ′ 2 31 21 11 23 33 holds, so the endpoints of the interval for α correspond to gimbal lock 2 2 where we have denoted ∆ =sec α-(γ33-γ23 tanα) and by abuse of singularity. Consider again the former rotation discussed above in this notation, γij are the matrix entries of  in the standard basis. Moreover, section (Figure 1c). The minimum at α ≈−74.97° yields about 35.82% ′ 22 0 the shift parameter α [−π,π] is unrestricted since one has γγ33+≤ 23 1 increase in efficiency. The optimal sequence of rotation angles in the . To illustrate this case, we consider a half-turn about n (5,4,3)t and decomposition this time is ∈ depict graphically the dependence (Figure 1b) ° ° ° ° ∼ φ ≈=2.39 , ϑ ≈−0.18 , ψ ≈−103.3 , α ≈−74.8 . γ(α)=|α|+|2arctanτ1|+|2arctan τ2 −α|+|2arctan τ3|. Note that the cost functions γ(α) in all examples above imply Note∊ that here α=0 is a local maximum of the cost function γ(α) either spherical or cylindrical symmetry of the spacecraft or aircraft. In ° ∊ that is somewhat surprising. The global minimum at α0≈−105.37 yields the case of significant anisotropy, however, due to different moments ° ∊ a total difference of γ(0)− γ(α0)≈50.65 , i.e., about 16.35% decrease in of inertia or external forces, e.g., gravitational, magnetic, air flow etc., ∊ ∊ A B C

Figure 1: Plot of Eγ(α) for (a) the XY XZ decomposition (3.1) of a rotation by an angle ϕ=−120° about the vector (3,4,5)t, (b) the ZXZX decomposition (3.2) of a half- turn about (5,4,3)t and (c) the former rotation in the XY ZX setting (3.18).

Figure 2: The examples considered above with a modified (weighted) cost function Eγ(α), the weights being chosen respectively κ1=1, κ2=1/2 and κ3=1/3.

J Appl Computat Math, an open access journal Volume 7 • Issue 3 • 1000410 ISSN: 2168-9679 Citation: Brezov D (2018) Optimization and Gimbal Lock Control via Shifted Decomposition of Rotations. J Appl Computat Math 7: 410. doi: 10.4172/2168-9679.1000410

Page 7 of 7 it is possible to adjust γ(α) by introducing specific weight for each function in SO (2,1) needs to be modified as formula in eqn. (33) tends rotation axis. For instance, in the decomposition in eqn. (7) one may to mix angles with rapidity’s. Another possible generalization may be replace in eqn. (33) with∊ seen in the context of screw dynamics modelled with dual quaternions and respectively, dual vector-parameters. The cost function in this =κ (|φ|+|α|)+κ |ϑ|+κ |ψ|, κ [0,1]. γ 1 2 3 i case would be a (weighted) path on the Galilean group of 3 rather 3 3 Figure∊ 2 depicts the weighted cost∈ functions in the examples than one on SO(3) = or  as in the above considerations. The considered above, the weights being κ1=1, κ2=1/2 and κ3=1/3 in all advantages of this approach in optimization and avoiding singularities three cases. Note that in the first setting the violation of the rotational may be utilized not only≅ in motion control but also areas like quantum symmetry does not alter much the graph of γ(α) apart from re-scaling information [3] or computer vision and virtual reality [1], but this goes and a slight shift of the minimum. In the second example, on the other beyond the scope of the present article and will be left for further study. ∊ hand, the minimum has moved to the singular point, thus reducing Acknowledgements the length of the optimal sequence from four to two, so we encounter a sort of phase transition. Finally, in the last case we observe an energy I am grateful to Professor Ivaılo Mladenov at the Bulgarian Academy of Sciences for inspiring my interest in vectorial parameterization and decomposition transfer between the two local minima. of rotations in 3 Concluding Remarks References The construction proposed in this paper has several advantages 1. Beckermann C (2002) Modeling of Solidification, in: Purdue Heat Transfer Celebration. April 3-5 University of Iowa, pp: 19-22. that seem quite useful in various practical situations. To begin with, it allows us to weaken the classical conditions due to Davenport 2. Rao PP, Chakrayerthi GACSK, B. Balakrishna (2011) Application of Casting Simulation for Sand Casting of a Crusher Plate. International Journal of and Lowenthal and thus, consider a wide variety of decomposition Thermal Technologies. geometries, e.g., tetrahedral or asymmetric, which satisfy a condition 3. Guharaja S, Noorul HA, Karuppannan KM (2006) Optimization of Green Sand of the type ∑γij ≥ π. Using this technique, on the other hand, it is easy Casting Process Parameters by Using Taguchis Method. The International to avoid gimbal lock configurations and more importantly, increase (in Journal of Advanced Manufacturing Technology 30: 1040-1048. some cases significantly) the energy efficiency of attitude adjustments 4. Jun HH (2006) Application of the software ProCAST in the casting used in spacecraft and aircraft maneuvers. Unlike other optimization of solidification simulation. Journal of Materials Science & Technology methods (e.g. the famous Wahba problem, it provides explicit exact 14: 292-295. solutions: numerical procedures are involved only at the final stage of 5. Chokkalingam B, Mohamed NSS (2009) Analysis of Casting Defect Through obtaining the minimum of the cost function γ(α), which is an almost Defect Diagnostic Study Approach. Journal of Engineering Annals of the trivial operation. We have chosen orthogonal axes to illustrate the Faculty of Engineering Hunedoara 2: 209-212. ∊ method just for the sake of simplicity and because this choice allows for 6. Trovant M, Argyropouos SA (1996) Mathematical modeling and experimental a wider range of α. Note also that our construction naturally extends to measurement of shrinkage in the casting of metals. Canadian Metallurgical the spin covering group SU(2) and therefore, may be applied (among Quarterly 35: 77-84. other things) to two level systems [3]. Quite a similar procedure can be 7. Bride M (1999) Numerical simulation of incompressible flow driven by density derived also for the group SO(2,1) and its spin cover SL(2,) =SU(1,1) variation during phase change. International. Journal for Numerical Methods based on analogous results [6] as long as one takes into account both in Fluids 3.1: 787-800. the gimbal lock and isotropic singularities. Let us point out≅ that in the 8. Kim C, Ro S (1993) Shrinkage Formation during the Solidification Process in hyperbolic case the former is far easier to control - one simply needs an Open Rectangular Cavity. ASME Journal of Heat Transfer 115: 1078-1081. to choose the first and the last invariant axes in the sequence to be of 9. Andreause U, Delliisola F (1996) On Thermo kinematic Analysis of Pipe different geometric types (like in the Iwasawa decomposition), while the Shaping in Cast Ingot: A Numerical Simulation via FDM. International Journal of Engineering Science 34: 1349-1367. latter is not affected by the shift parameter since in the singular setting the tangent to the light cone is an invariant subspace independent 10. Paszndiden-Fard M, Chandra S, Mostaghimi J (2002) A Three Dimensional Model of Droplet Impact and Solidification. Journal of Heat Mass Transfer 45: on the specific values of the τi’s. Moreover, the definition of the cost 2229-2242.

J Appl Computat Math, an open access journal Volume 7 • Issue 3 • 1000410 ISSN: 2168-9679