=Paper= {{Paper |id=Vol-2254/1000051 |storemode=property |title=Mathematical modelling of the stabilization system for a mobile base video camera using quaternions |pdfUrl=https://ceur-ws.org/Vol-2254/10000051.pdf |volume=Vol-2254 |authors=Alexander Isaev,Anna Adamchuk,Stanislav Amirokov,Mikhail Isaev,Mikhail Grazhdankin }} ==Mathematical modelling of the stabilization system for a mobile base video camera using quaternions== https://ceur-ws.org/Vol-2254/10000051.pdf
Mathematical modelling of the stabilization system for a
     mobile base video camera using quaternions

          Alexander M. Isaev          Anna S. Adamchuk           Stanislav R. Amirokov
                NCFU                        NCFU                         NCFU
          Stavropol, 355000            Stavropol, 355000           Stavropol, 355000
           isaev@stilsoft.ru       adamchuk anna@mail.ru            amirsr@mail.ru
                         Mikhail A. Isaev           Mikhail A. Grazhdankin
                             NCFU                           NCFU
                        Stavropol, 355000              Stavropol, 355000
                     isaevmickle@gmail.com          mikexxx2007@yandex.ru
                                          North Caucasus Federal University




                                                        Abstract

                       The purpose of this research is to develop a control system for spa-
                       tial stabilization of a gimbal video camera platform with 2 degrees of
                       freedom.
                       The mathematical quaternion theory is applied, which allows to cre-
                       ate a convenient and intuitive formalism that uses Rodrigues-Hamilton
                       parameters to describe spatial orientation of a solid body.
                       The method suggested in the research provides a solution for the task
                       of stabilizing a suspended video camera control system. It has been
                       shown as well that from the computational engineering standpoint, this
                       method appears to be the most optimal.
                       The originality of the method is explained by the application of the
                       quaternion algebra transformations in order to determine orientation
                       and to stabilize a video camera on a biaxial suspension. This method
                       allows to utilize mechanical systems with various positions of camera
                       drive units.




1    Introduction
Evolution and wide implementation of mobile robots leads to actualization of the development process of stabi-
lization systems for payload (video cameras, thermal imagers, sensors and etc.) spatial positioning.
   The development of stabilization systems is associated with the problem of determining orientation of a solid
body that arises in various engineering tasks, for example – controlling antenna-based surveillance systems,
controlling video equipment which is located on mobile platforms, controlling unmanned aerial vehicles and etc.

Copyright c by the paper’s authors. Copying permitted for private and academic purposes.
In: Marco Schaerf, Massimo Mecella, Drozdova Viktoria Igorevna, Kalmykov Igor Anatolievich (eds.): Proceedings of REMS 2018
– Russian Federation & Europe Multidisciplinary Symposium on Computer Science and ICT, Stavropol – Dombay, Russia, 15–20
October 2018, published at http://ceur-ws.org
    Let us consider the objective of mathematical modelling for a platform spatial stabilization control system
with a video camera on a suspension with 2 degrees of freedom. This objective has a meaning if a referential
coordinate system is established, which is then used to determine solid body orientation.
    To solve the existing objective, 7 different coordinate systems are used: inertial F I which is tied to Earth;
F , F 2 – stabilized platform and frame coordinate systems; F B1 , F B2 – tied to a stabilized platform and a
  1

suspension frame; F I2 , F I2 – auxiliary free azimuth coordinate systems.
    The purpose of the suggested method is to create a mathematical model for a platform spatial stabilization
control system with a video camera on a suspension with 2 degrees of freedom.
    In order to achieve the desired goal, the following objectives need to be resolved:

    1. Describe a kinematic scheme for the video camera suspension;

    2. Provide main definitions and operations of the quaternion theory that are necessary for mathematical
       modelling of the video camera suspension stabilization and control system;

    3. Derive kinematic equations which bind a solid body angular velocity vector to time derivatives based on
       kinematic parameters of the model;

    4. Analyze sensor signals and errors;

    5. Provide a description for instrumental basis composition and its correction based on reference points available
       for measurements.

2      References review
Spatial positioning stabilization mechanisms are widely used in various modern equipment. The purpose of
spatial positioning stabilization equipment is to isolate payload from external perturbations. Such systems are
applicable in cinematography[Lew08], unmanned aerial vehicles [Bra12], missile guidance systems[Yu17] and
etc. Stabilization systems in general may have three axes of angular stabilization – based on yaw, pitch and
roll[Nyb17], but more commonly 2 axes – based on yaw and pitch[Abd13], [Dey14], [Bas17], [Saj13]. The most
common regulator that is used to control drive units is PID[Nyb17], [Abd13], [Dey14], while controllers with
fuzzy logic[Bas17] and LQR[Saj13] are used less frequently. Practically all of the modern systems utilize brushless
direct current motors as their drive units[Bra73].

3      Materials and methods
3.1     The description of the video camera suspension kinematic scheme.
The kinematic scheme of the video camera suspension is provided on figure 1.
   While determining spatial orientation of a solid body in relation to a referential coordinate system, the
following sensors are used: angular velocity meters – gyroscopes, as well as meters of a sum of linear and
gravitational acceleration – accelerometers. The sum of linear and gravitational acceleration is referred to as
apparent acceleration. In the general case, to determine spatial orientation, integrated readings of three angular
velocity sensors, which are located mutually perpendicular, are used as the main source of information. Spatial
position correction is applied based on accelerometer readings, with the assumption that no linear acceleration
is present.
   Let us provide a description of all 7 coordinate systems used in the research.
   Inertial coordinate system F I s tied to Earth, unit vector i1 is directed towards north, j 1 is directed towards
east, k l is directed down towards the center of Earth. This system is often called NED – North, East, Down.
The north direction is designated as inertial x , the east direction – as inertial y, the down direction – as inertial
z[Ren15].
   Coordinate system F 1 – the origin point of this coordinate system is located at the stabilized camera platform
center of gravity, the axes match the NED system.
   Coordinate system F 2 – the origin point of this coordinate system is located at the junction point of the
suspension frame to the carrier, the coordinate system axes match the NED system.
   Coordinate system F B1 hat is tied to the platform – the origin point corresponds to the center of gravity of
the stabilized camera platform. x axis is directed forward by the camera optical axis, y axis is directed to the
           Figure 1: The kinematic scheme of the video camera gimbal with two degrees of freedom

right by drive unit axis M1 , z axis supplements the coordinate system up to the right. Unit vectors i, j, k, which
correspond to x, y, z axes of this coordinate system, form basis E1 that is tied to the stabilized platform.
    Coordinate system F B2 that is tied to the suspension frame – the origin point matches the junction point of
the suspension frame to the carrier, x axis is directed forward towards the stabilized platform, z axis is parallel
to the frame and is directed to the opposite side of the frame and carrier junction point, y axis supplements the
coordinate system up to the right, drive unit axis M2 lies on the plane which is formed by axes x and z. Vectors
i, j, k, which correspond to x, y, z axes of system F B2 , form basis E2 that is tied to the suspension frame.
    Coordinate system F I1 – free in azimuth, the origin point is located in the stabilized platform center of
gravity, z axis corresponds to the gravitational acceleration vector direction, the camera optical axis is in the
plane formed by x and z axes, the axes supplements coordinate system F I1 up to the right. Basis I1 which is
formed by vectors i, j, k, that correspond to x, y, z axes of coordinate system F I1 , shall acquire the referential
basis role during the process of calculating the stabilized platform resultant rotation quaternion correction and
constructing the platform control.
    Analogically to system F I1 , coordinate system F I2 – free in azimuth, the origin point corresponds to the
frame and carrier junction point, z axis corresponds to the gravitational acceleration vector direction, the drive
unit motor axis based on roll is located in the plane that is formed by x and z axes, y axis supplements system
F I2 up to the right. Basis I2 which is formed by vectors i, j, k, that correspond to x, y, z axes of coordinate
system F I2 , shall fulfill the referential basis role during the process of determining the suspension frame resultant
rotation quaternion correction.
    The video camera suspension stabilization system utilizes 2 inertial spatial position sensors. The sensor consists
of a combination of 3 gyroscopes and 3 accelerometers with axes, which are positioned mutually perpendicular,
as well as a microcontroller that carries out preliminary processing of the obtained data. The inertial sensor
measures the projections of the angular velocity vector on to sensitivity axes x, y, z, of a micro electromechanical
gyroscope and the projections of apparent acceleration on to the sensitivity axes x, y, z of a micro electromechan-
ical accelerometer. The first sensor is positioned directly on the camera platform, measurements are carried out
in tied coordinate system F B1 . The second sensor is mounted on the suspension frame, measurements are carried
out in tied coordinate system F B2 . Processing of the signals from the spatial position sensors and formation
of the controlling actions for the camera drive units is carried out by a specialized controller. Direct control of
the camera spatial position is provided by brushless direct current motors based on two axes, one camera drive
unit is located on the stabilized camera platform directly, the other one is located on the suspension frame. The
application of such motors with direct camera drive ensures absence of mechanical slack and high positioning
accuracy of the stabilized platform.

3.2   The main definitions and operations of the quaternion theory
There are several different kinematic parameters that are used to describe rotary motion of a solid body around
a static point: guiding cosines, Euler’s angles, Rodrigues-Hamilton parameters. Some of the most convenient
parameters are Rodrigues-Hamilton parameters, which represent quaternion components[Bra73]. These param-
eters do not degenerate (nether the parameters themselves, nor the rates of their change become indefinite) with
any position of a solid body; unlike Euler’s angles, the number of Rodrigues-Hamilton parameters equals four;
there is only one binding equation for these parameters (unlike six equations when guiding cosines are applied).
Final rotation of a solid body can be expressed as rotation around a static axis by some degree. According to
the Euler’s theorem[Bra73], [Lyr61]:“any rotary motion of a solid body is equivalent to flat rotation around a
certain axis and can be determined by the final rotation around this axis or by the final rotation vector, which is
directed by the axis of Euler’s rotation and has the length that depends on the rotation angle”.
   The final rotation vector determines Rodrigues-Hamilton parameters. To describe the solid body spatial
position, let us apply the quaternion theory, which shall provide a convenient way of recording the operations that
are tied to modelling solid body movements and the operations of projecting vector values from one coordinate
system to another. Quaternion – a number composed of real unit 1 and three imaginary units i, j, k, with real
elements:
                                    Λ = (λ0 , λ1 , λ2 , λ3 ) = λ0 1 + λ1 i + λ2 j + λ3 k                        (1)
Units 1, i, j, k may be considered unit vectors of four-dimensional space, which is defined as H. Any quaternion
in this space can be represented by a point or a radius vector. Addition of the vectors and their multiplication
by a scalar in H dimension is executed analogically to the regular vector dimension[Bra73]. The quaternion that
is expressed in the Rodrigues-Hamilton parameters has the following coordinates[Bra73]:

                                   ϑ                ϑ                  ϑ                ϑ
                           λ0 = cos ,    λ1 = y1 sin ,      λ2 = y2 sin ,    λ3 = y3 sin .                       (2)
                                   2                2                  2                2
   Where y1 , y2 , y3 – guiding cosines of vector Θ that represents the axis of Euler’s rotation of the solid body, ϑ
– value of the rotation angle around this axis. It is known that quaternion N , which is defined as a result of
multiplying the quaternions N and M with known parameters:

                             Λ = λ0 + λ1 i + λ2 j + λ3 k,    M = µ0 + µ1 i + µ2 j + µ3 k                         (3)
  has the following form and is calculated with the following formula:

                                  N = Λ ⊗ M,     where N = ν0 + ν1 i + ν2 j + ν3 k                               (4)
  while its components with i, j, k have the following form[Bra73]:

                                      ν0 = λ0 µ0 − λ1 µ1 − λ2 µ2 − λ3 µ3
                                      ν1 = λ0 µ1 − λ1 µ0 − λ2 µ3 − λ3 µ2
                                      ν2 = λ0 µ2 − λ2 µ0 − λ3 µ1 − λ1 µ3
                                      ν3 = λ0 µ3 − λ3 µ0 − λ1 µ2 − λ2 µ1

  If we change the order of the cofactors, considering product M ⊗ Λ, then the determinant in formula 4 shall
change, lines λ and µ shall exchange their positions, thus, multiplication of the quaternions is non-commutative.
  Quaternion Λ̃ , conjugated to given quaternion Λ, has the following form:

                                          Λ̃ = λ0 , −λ1 i, −λ2 j, −λ3 k

  The quaternion norm – scalar:

                                             ||Λ|| = λ20 + λ21 + λ22 + λ23
A quaternion with the norm ||Λ|| = 1 is referred to as normalized quaternion.
3.3   The kinematic equations
The kinematic equations that bind the angular velocity vector in tied ω
                                                                      ~ E and referential ω
                                                                                          ~ I coordinate systems
with time derivatives based on the kinematic parameters have the following form [Bra73]:

                                                  dΛ  1
                                                     = Λ⊗ω
                                                         ~E                                                     (5)
                                                  dt  2
                                                  dΛ     1
                                                      = ω  ~I ⊗ Λ                                                (6)
                                                  dt     2
   Movement for the sensor in basis E1 , which is tied to the camera, and for the sensor in basis E2 , which is tied
to the mobile base, is described by the kinematic equations:

                                     2Λ̇1 = Λ1 ⊗ ω
                                                 ~ E1 ,    2Λ̇2 = Λ2 ⊗ ω
                                                                       ~ E2                                     (7)

   Here ω        ~ E2 – projections of angular velocities on the gyroscopes axes in coordinate systems F 1 and F 2
        ~ E1 and ω
correspondingly. After a transformation of these expressions, we shall obtain the approximate equations:
                                                                   1
                                        Λ1 (t + dt) = Λ1 (t) ⊗ (1 + ω~ E dt)                                    (8)
                                                                   2 1
                                                               1
                                    Λ2 (t + dt) = Λ2 (t) ⊗ (1 + ω~ E dt)                                        (9)
                                                               2 2
  Now equations (5), (6) may be rewritten as:

                                              Λ(t + dt) = Λ(t) ⊗ Ndt                                           (10)

                                              Λ(t + dt) = Ndt ⊗ Λ(t)                                           (11)
   Here multiplier Ndt – quaternion of the solid body final rotation in indefinitely small timeframe dt hich for
the angular velocity meters located in the tied basis has the following form:
                                                          1
                                                 Ndt = 1 + ω~ E dt                                             (12)
                                                          2
  Similarly, for the meters located in the referential basis:
                                                          1
                                                 Ndt = 1 + ω~ I dt                                             (13)
                                                          2
   In our case, the meters that measure angular velocity vector projection are physically located in the tied
coordinate system, hence, we shall consider the equations that have the type of equation (5) or the transformed
equations like equation (10) . Further, it is possible to apply the approximate numerical methods of integrating
the kinematic equations in Rodrigues-Hamilton parameters: the first-order method (Euler’s method), which is
described by formula (12) or the second-order method (modified Euler’s method), which is described by formula
(13):
                                                      1         1
                                           Ndt = 1 + ω            ωE dt|2
                                                        ~ E dt + |~                                           (14)
                                                      2         2
   In formulas (8), (9) dt – angular velocity vector change time interval.
   Integration of the kinematic equations by methods (13) and (14) leads to deviation (recession) of the resultant
quaternion ||Λ|| norm from one. When implementing such methods on a microcontroller, it is necessary to
monitor the norm deviation from 1 and periodically subject the resultant quaternion to normalization using
formula (15).
                                                          λ0   λ
                                                  Λ=         +                                                 (15)
                                                          |Λ| |Λ|
                p
  where |Λ| = ||Λ||.
  It is also possible to utilize other integration methods of the kinematic equations with norm correction[Bra92].
  Let us designate the relation of the quaternion defined in Rodrigues-Hamilton parameters with Euler’s
angles[Ver09].
  In the referential coordinate system, rotation by the angle of yaw ϕ is executed around axis z in plane XOY ,
by the angle of pitch ϑ – around axis y, by the angle of roll ψ – around axis x.


                                                             2(λ2 λ0 − λ1 λ3 )
                                     Yaw angle:   ϕ = arctan[                  ]                               (16)
                                                             1 − 2(λ22 − λ23 )
                                    Pitch angle: ϑ = arcsin(2λ1 λ2 − 2λ0 λ3 )                                  (17)
                                                             2(λ2 λ0 − λ1 λ3 )
                                     Roll angle: ψ = arctan[                   ]                               (18)
                                                             1 − 2(λ22 − λ23 )

   The relation formulas for the components of the quaternion, which is defined in Rodrigues-Hamilton param-
eters, with Krylov’s angles have the following form[Bra73]:


                                      ϕ      ψ      ϑ        ϕ      ψ      ϑ
                             λ0 = cos( ) cos( ) cos( ) + sin( ) sin( ) sin( )                                  (19)
                                      2      2      2        2      2      2
                                      ϕ      ψ      ϑ        ϕ      ψ      ϑ
                             λ1 = cos( ) sin( ) sin( ) − sin( ) cos( ) sin( )
                                      2      2      2        2      2      2
                                      ϕ      ψ      ϑ        ϕ      ψ      ϑ
                             λ2 = cos( ) cos( ) sin( ) + sin( ) sin( ) cos( )
                                      2      2      2        2      2      2
                                      ϕ      ϑ      ϑ        ϕ      ψ      ϑ
                             λ3 = sin( ) cos( ) cos( ) − sin( ) sin( ) sin( )
                                      2      2      2        2      2      2

3.4   Sensor signals
Output signal of the triaxial gyroscope ω
                                        ~ out can be represented as a sum of the actual value of angular velocity
vector ω
       ~ and generalized error ∆~ω [Sye09]:

                                                  ω
                                                  ~ out = ω
                                                          ~ + ∆~
                                                               ω                                               (20)

  where the generalized gyroscope error can be expressed in a simplified form as

                                           ∆~
                                            ω = bω~ + S~
                                                       ω + Nω
                                                            ~ + ξ(~
                                                                  ω)                                           (21)

   Here, bω~ – gyroscope drift, S – scale factor matrix, N – matrix that describes non-orthogonality of the
sensitivity axes, ξ(~
                    ω ) – gyroscope noise.
   In a more comprehensive way, gyroscope errors may be represented as a sum of the summands[Ver09] that
include constant temperature drifts of the gyroscope; arbitrary measurement noises; specific gyroscope drifting
speed, which is proportional to G-force; errors of gyroscope scale coefficients; drift caused by non-orthogonality
of gyroscope sensitivity axes; drift caused by sag in sensitivity axes relative to the device housing; for a micro
electromechanical gyroscope, a non-linearity error of the scale coefficient should be included.
   Analogically to the gyroscopes, the output signal of the apparent acceleration meters is expressed as a sum
of the apparent acceleration actual value and the generalized error value:

                                                  ~aout = ~a + ∆~a                                             (22)

  where the generalized error can be expressed in the following form[Sye09]:

                                     ∆~a = b~a + S1~a + S2~a + N~a + δg + ξ(~a)                                (23)

   Here, b~a – offset, S1 and S2 – matrixes of linear and non-linear scale coefficients, N – matrix that describes
non-orthogonality of the sensor measuring axes, δg – deviation from the theoretic gravitational acceleration
value, ξ(~a) – accelerometer noise. Matrixes S1 , N , offset b~a may be found during calibration by a method similar
to[Isa16].
4     Results
4.1    Instrumental basis construction and correction[Bra92]
Let us demonstrate the instrumental basis construction process based on the stabilized platform example.
   It is possible to determine a complete spatial position of a body only when two or more reference points, which
have their lines of sight located on non-collinear vectors, are available. In our case, it is only possible to utilize
one reference point – the gravitational acceleration vector. Therefore, we only have the capability to model the
plane formed by vectors i and j. When calculating final rotation quaternion Λ1 using formula (10), an integration
of all the gyroscope signal constituents takes place, which, supplemented by the error of the integration method,
leads to incremental errors in the instrumental basis construction. Thus, instrumental basis I1∗ emains free in
azimuth, that is, it has uncompensated rotation angular velocity around vector k, determined mostly by drift of
the gyroscopes located in tied coordinate system F B1 (basis E1 ).
   The spatial position of the sensor in basis I1 is described by final rotation quaternion Λ1 ; it is required to
construct instrumental basis I1∗ which models referential basis I1 in such a way that I1∗ → I1 and, correspondingly,
Λ∗1 → Λ1 [Bra92].
   Let us consider the calculation of the alignment plane construction error in instrumental basis I1∗ for the
sensors located in basis E1 [Bra92].
   Reference point direction unit vector iI1 (the gravitational acceleration vector direction) shall have in its
referential basis I1 components α = 0, β = 0, γ = 1g, where g – gravitational acceleration:

                                                 iI1 = αi + βj + γk                                              (24)
    The same components shall be included in reference point direction unit vector iI2 in basis I2 .

                                                 iI1 = αi + βj + γk                                              (25)
    Unit vector i∗I2 in instrumental basis I1∗ shall have the same components, in[Bra92], this unit vector is referred
to as a reference point model.

                                                i∗I2 = αi∗ + βj∗ + γk∗                                           (26)
    The reference point direction unit vector and its model are connected by the following relation:

                                                i∗I2 = RI1 ⊗ iI1 ⊗ R̃I1                                          (27)
  Here RI1 – quaternion of the mismatch of instrumental basis I1∗ relative to referential I1 .
  The solution of the objective of constructing the alignment plane in basis I1 is carried out in such a way that
RI1 → (1, 0, 0, 0).

4.2    Calculating the error in the instrumental basis plane construction
Let us consider the correction construction for the stabilized platform final rotation quaternion.
  The vector of reference point iI1 and its model i∗I1∗ mismatch has the following form[Bra92]:

                                                    σ1 = iI1 − i∗I1                                              (28)
  The reference point in our case is the following: iI1 = (0, 0, 1g), where g – gravitational acceleration.
  The reference point model, as a projection of apparent acceleration measurement vector iB1 from tied basis
E1 in nstrumental basis I1∗ , has the following form:

                                                    i∗I1 = Λ∗1 ⊗ Λ̃∗1                                            (29)
   The correction control of the alignment plane between the instrumental basis and the referential basis is
calculated in basis I1∗ using the following formula:

                                                  ~ I2∗ = f (σ1 × i∗I1 )
                                                  ω                                                              (30)
    The alignment construction of the plane formed by vectors i, 0, j of instrumental basis I2∗ , to the plane formed
by i, 0, j of referential basis I2 for the suspension frame is executed analogically.
                                                          σ2 = iI2 − i∗I2                                                        (31)


                                                      i∗I2 = Λ∗2 ⊗ iB2 ⊗ Λ˜∗2                                                    (32)


                                                        ω~I2∗ = f (σ2 × i∗I2 )                                                   (33)

4.3   Rotation velocity synchronization for instrument bases I1∗ and I2∗ in the azimuth plane
In our case, the only reference for the spatial position construction is still the gravitational acceleration vector,
therefore, it is only possible to construct a plane perpendicular to the reference point vector. Wherein, it is
impossible to determine the azimuth direction of instrumental bases I1∗ and I2∗ without including the data about
an additional reference point, which should not provide the direction that is collinear to the first vector. The
example of such a vector is the Earth’s magnetic field vector.
    Constructively, the yaw angles of the stabilized platform and the frame match, except for the case of exceeding
the stabilized platform pitch angle −90◦ . Nevertheless, due to uncompensated drift of the gyroscopes located
in tied bases E1 and E2 , azimuth divergence of instrumental bases I1∗ and I2∗ occurs, which grows incrementally
with time (while the device may be physically static) and renders it impossible to construct a stable stabilization
system.
    To resolve this problem, it is required to synchronize the rotation speed of bases I1∗ and I2∗ in the azimuth
plane. Let us deem I1∗ to be the guiding basis, and I2∗ to be the corrected basis.
    In[Bra92], 2 methods of correcting the instrumental basis based on two reference points are considered. The
first method is superposition of the reference points directions, the second – gradual correction, i.e. the con-
struction of an alignment plane and rotation by the mismatch angle in the constructed plane. In this research,
the first technique of correction is applied.
    Let us determine yaw angles of the stabilized platform and the suspension frame ψ1∗ and ψ2∗ by using the
components of quaternions Λ∗1 and Λ∗2 with formula (16).
    The azimuth mismatch of bases I1∗ and I2∗ is described by the following angle:

                                                         ϕ∗err = ϕ∗1 − ϕ∗2                                                       (34)
  The yaw angle mismatch correction vector for quaternion Λ∗2 shall have the following form:

                                                        ∗
                                                      ω
                                                      ~ yaw = f (0, 0, ϕ∗err )                                                   (35)
  The total correction vector for quaternion Λ∗2 in referential basis I2∗ is calculated with the following formula:

                                                      ~ I∗2∗ corr = ω
                                                      ω             ~ I2∗ + ω ∗
                                                                            ~ yaw                                                (36)
  The correction for the sensors located in tied bases E1 and E2 can be calculated by the rules of redesigning:

                                                ω
                                                ~E∗
                                                    1
                                                      = f (Λ̃∗1 ⊗ (σ1 × i∗I1∗ ) ⊗ Λ∗1 )                                          (37)
  For the sensor mounted on the suspension frame, we shall have:

                                             ∗
                                           ω
                                           ~E  2
                                                 = f (Λ̃∗2 ⊗ (~
                                                              ωI∗2∗ corr + ω ∗
                                                                           ~ yaw ) ⊗ Λ∗2 )                                       (38)
  To increase the alignment accuracy between the instrumental and the referential bases, an integral correction
can be applied in the form of[Bra92]:

                   ω
                   ~E∗
                       1
                         = f (Λ̃∗1 ⊗ (σ1 × i∗I1∗ ) ⊗ Λ∗1 ) + µ1 ,    where µ̇1 = f1 (Λ̃∗1 ⊗ (σ1 × i∗I1∗ ) ⊗ Λ∗1 )                (39)
  The correction of frame final rotation quaternion Λ∗2 is calculated with the following way:

             ∗
           ω
           ~E  2
                 = f (Λ̃∗2 ⊗ (~
                              ωI∗2∗ corr + ω ∗
                                           ~ yaw ) ⊗ Λ∗2 ) + µ1 ,   where        µ̇1 = f (Λ̃∗2 ⊗ (~
                                                                                                  ωI∗2∗ corr + ω ∗
                                                                                                               ~ yaw ) ⊗ Λ∗2 )   (40)

  Equation (8) with the correction considered is expressed as:
                                                                  1
                                     Λ∗1 (t + dt) = Λ∗1 (t) ⊗ (1 + (~
                                                                    ωE1 − ω
                                                                          ~E∗
                                                                                ))dt                               (41)
                                                                  2           1



                                                              1
                                 Λ∗2 (t + dt) = Λ∗2 (t) ⊗ (1 + (~
                                                                ωE2 − ω
                                                                      ~E∗
                                                                            ))dt                            (42)
                                                              2           2


  The introduction of the instrumental basis correction through angular velocity provides sustainable alignment
between the instrumental and referential bases. Therefore, basis I2∗ → I1∗ .

4.4   Determination of the original position quaternion
Prior to activating the stabilization system, it is necessary to determine the components of the quaternions that
describe the spatial orientation of the stabilized platform and the frame. The quaternion components can be
calculated using formula (19) , assuming that yaw angle ϕ s set equal to zero, and the angles of pitch θ and roll
ψ are calculated using the accelerometer data.
   It is also possible to engage the system at once with the starting conditions specified:

                                         Λ∗1 = (1, 0, 0, 0),   Λ∗2 = (1, 0, 0, 0).
   Herewith, the integral component of the correction must not be utilized, the initialization is considered
complete when the model of reference point vector i∗I1∗ , which is calculated with formula (29) matches the value
of reference point iI1 = (0, 0, 1g) with specified accuracy. Hereupon, the integral component of the instrumental
basis correction is implemented.
   The instrumental basis correction algorithm is provided on figure 2.

4.5   Constructing the control of the camera platform spatial position
The camera platform spatial position control is physically carried out in various coordinate systems. The pitch
control drive unit is located on the camera directly, i.e. it is in the basis tied with the camera, the roll control
drive unit is located on the mobile base – in the frame basis. Therefore, the necessity of constructing the control
in a certain common basis arises.
   For our modelled system, when basis I2∗ → I1∗ , the control construction in any of the bases shall be identical.
Let us consider the construction of the specified camera spatial position quaternion.
   Constructively, the stabilization system does not include a yaw control drive unit, based on that, yaw – ϕ is
calculated with the components of quaternion Λ∗1 using formula (16).
   Roll angle – ψ is set equal to 0, pitch angle ϑ s set within boundaries (− π2 ; π2 ).
   The components of defined spatial position quaternion Λd are calculated with formula (19).
   The quaternion of mismatch between the actual and the defined stabilized platform spatial orientation can be
calculated both in the tied basis using formula (43),

                                                                ∗
                                                    ΛE
                                                     r = Λ̃d ⊗ ΛI                                                  (43)
  and in the referential using formula (44):

                                                     ΛIr = Λ∗I ⊗ Λ̃d                                               (44)

4.6   Constructing the platform spatial orientation control based on the mismatch quaternion
      components
The mismatch quaternion components (43) can be utilized as a controlling signal.
     “The application of the quaternion components as controlling signals allows to achieve not only stable control
of solid body movement, but, in some cases, a state of control that is close to optimal”[Bra73]. The theoretic
ground for the application of the mismatch quaternion components in the construction of the controlling actions
is also provided in[Bra73].
     For cases of small deviation, tied to the stabilized platform of basis E1 , from the position defined by quaternion
Λd , approximate relations for mismatch quaternion ΛIr = (λr0 , λr1 , λr2 , λr3 ), which is calculated in guiding basis
I1∗ , shall be appropriate[Bra73].
                               Figure 2: The instrumental basis correction algorithm



                                             ψ ≈ 2λr0 λr10 ,      ϕ ≈ 2λr0 λr3                                       (45)
     Since the control construction in any of bases I1∗ is identical for case I2∗ → I1∗ , the orientation control shall be
constructed in basis I1∗ .
     For direct control of the motors, an integral back-stepping controller is used[Bou07]. Let us briefly specify the
realization of this control method using the example of pitch-based control relative to axis y in referential basis
I1∗ .
     The angle setting error is:

                e1 = ϑ d − ϑ   where ϑd – desired angle, ϑ – actual stabilized platform pitch angle.                 (46)
  In this controller realization, the defined angle setting error shall be expressed by mismatch quaternion com-
ponents (45):

                                                      e1 = 2λr0 λr2                                                  (47)
   The software correction speed:

                                                ωdy = c1 e1 + ϑ̇d + λ1 χ1                                            (48)
   Here c1 , λ1 – positive constants,
                                                           Z t
                                                    χ1 =         e1 (t)dt                                            (49)
                                                            0

   The y axis angular velocity tracking error is:
                                                     e2 = ωdy − ωIy∗                                              (50)
                                                   ~ I1∗ on axis y in instrumental basis y, which is derived by
  here ωIy∗ – component of angular velocity vector ω
projecting this vector from tied basis E1 :

                                                  ~ I1∗ = Λ∗1 ⊗ ω
                                                  ω             ~ E1 ⊗ Λ̃∗1                                       (51)
    The controlling action for the drive unit on axis y is:

                                   Uy = b1 (1 − c21 + λ1 )e1 + (c1 + c2 )e1 − c1 c2 λ1 ξ1                         (52)
    The controlling actions on axes x and z are calculated analogically.
    The common vector of the controlling actions in referential basis I1∗ :

                                                  ~ I ∗ = (Ux , Uy , Uz )
                                                  U                                                               (53)
                                                     1




                     Figure 3: The stabilized platform drive units control formation algorithm

    Since I2∗ → I1∗ , it is possible to express the projections of controlling actions in the tied coordinate systems:

                                   ~ E = Λ̃∗1 ⊗ U
                                   U            ~ I ∗ ⊗ Λ∗1 ,   ~ E = Λ̃∗2 ⊗ U
                                                                U            ~ I ∗ ⊗ Λ∗2                          (54)
                                      1            1               2            1

  Considering that constructively the pitch drive unit motor of the stabilized platform is located on axis y in
basis E1 , and the roll drive unit motor is on axis y of basis E2 , in order to control the motors, the corresponding
components of vectors U  ~ E and U ~ E are used.
                            1         2
  The algorithm of control formation for the stabilized platform drive units is provided on figure 3.

5    Conclusion
Application of the method described in the article to form control for the drive units allows to implement
various kinematic schemes of spatially stabilized platforms. Utilization of the quaternion algebra improves
calculation efficiency of the managing controller. The described spatial stabilization system for a video camera
on a suspension is realized in the device which was created in the laboratory.
References
[Lew08] M. Lewis. Stabilization, Steering, and Gimbal Technology as it relates to Cinematography.: Proprietary
        PV Labs Inc, 2008.
[Bra12] N. J. Brake. Control System Development for Small UAV Gimbal.: In Partial Fulfillment of the
        Requirements for the Degree Master of Science in Aerospace Engineering California Polytechnic State
        University, 2012
[Yu17]    N. Yu, J. Shang. A Uniform Method of Mechanical Disturbance Torque Measurement and Reduction
          for the Seeker Gimbal in the Assembly Process.: Mathematical Problems in Engineering Volume 20170,
          Article ID 2179503, 2017.
[Nyb17] L. Nyberg, M. Tjellander. Camera stabilization.: KTH Royal Institute of Technology School of Industrial
        Engineering and Management. // Stockholm Sweden, 2017.
[Abd13] M. Abdo, A. R. Toloei, A. R. Vali, M. R. Arvan. Research on the Cross-Coupling of Two Axes Gimbal
        System with Dynamic Unbalance.: International Journal of Advanced Robotic System. vol.10, pp. 1-13,
        2013.
[Dey14] S. Dey14, S. Handler. Nandakumar M.P. Gyroscopic Stabilization of Two Dimensional Gimbals Plat-
        form Using Fuzzy Logic Control.: International Journal of Electrical, Electronics and Data Communi-
        cation, vol. 2, no. 8, pp. 36-42, 2014.
[Bas17] M. Baskin, K. Leblebicioglu.           Robust control for line-of-sight stabilization of a two-
        axis gimbal system.:        Turkish Journal of Electrical Engineering Computer Sciences. /
        http://journals.tubitak.gov.tr/elektrik/, pp. 3839 – 3853, 2017.
[Saj13]   P. Sajitha, Ali M. Jashper. Direct Torque Control of a BLDC Motor Based on Computing Technique.:
          IOSR Journal of Electrical and Electronics Engineering. // Volume 6, Issue 6 (Jul. - Aug.), pp. 01-08,
          2013.
[Bra73] V.N. Branec, I. P. Shmiglevskiy. Primenenie kvaternionov v zadachah orientatsii tverdogo tela. M.:
        Nauka, Glavnaya redaktsiya fiziko-matematicheskoy literaturyi, 1973 – 320 s.
[Bra92] V.N. Branec, I. P. Shmiglevskiy. Vvedenie v teoriyu besplatformennyih inertsialnyih navigatsionnyih
        sistem. M.: Nauka, Glavnaya redaktsiya fiziko-matematicheskoy literaturyi, 1992 – 280 s.
[Lyr61]   A. I. Lyre. “Analiticheskaya mehanika”. M.: Gosudarstvennoe izdatelstvo fiziko – matematicheskoy
          literaturyi, 1961 – 825 s
[Bes75]   V.A. Besekerskiy, E. P. Popov. Teoriya sistem avtomaticheskogo regulirovaniya. – M.: Nauka, Glavnaya
          redaktsiya fiziko-matematicheskoy literaturyi, 1975 – 768 s.
[Fab64] N. Ya. Fabrikant. AERODINAMIKA obschiy kurs: uchebnoe rukovodstvo/ N. Ya. Fabrikant. – M.:
        Nauka, 1964 – 816 s.
[Ver09]   K. K. Veremeenko, S. Yu. Zheltov i dr. Sovremennyie informatsionnyie tehnologii v zadachah navigatsii
          i navedeniya bespilotnyih manevrennyih letatelnyih apparatov. // M.: FIZMAT-LIT, 2009 g., 556 s
[Ren15] Rendal U. Biard, Timoti U. MakLeyn. Malyie bespilotnyie letatelnyie apparatyi: teoriya i praktika. M.
        “TEHNOSFERA” 2015–312 s.
[Sye09]   Z. Syed. Design and implementation issues of a portable navigation system: PhD Thesis. – Calgary,
          Canada: The University of Calgary, 2009 – 230 p.
[Bou07] S. Bouabdallah. Design and control of quadrotors with application to autonomous flying: PhD Thesis.
        – Lausanne, Switzerland: École Polytechnique Federale de Lausanne, 2007 – 155 p.
[Isa16]   A. Isaev. Kalibrovka datchika magnitnogo polya s pomoschyu matritsyi korrektsii. “Aktualnyie nauch-
          nyie issledovaniya v sovremennom mire” ISCIENCE.IN.UA Vyipusk 12(20) Pereslav Hmelnitskiy 2016.