Sliding Surface Designs for Visual Servo Control of Quadrotors

: Autonomy is the main task of a quadrotor, and visual servoing assists with this task while providing fault tolerance under GPS failure. The main approach to visual servoing is image-based visual servoing, which uses image features directly without the need for pose estimation. The classical sliding surface design of sliding mode control is used by the linear controller law of image-based visual servoing, and focuses only on minimizing the error in the image features as convergence. In addition to providing convergence, performance characteristics such as visual-feature-convergence time, error, and motion characteristics should be taken into consideration while controlling a quadrotor under velocity limitations and disturbance. In this study, an image-based visual servoing system for quadrotors with ﬁve diﬀerent sliding surface designs is proposed using analytical techniques and fuzzy logic. The proposed visual servo system was simulated, utilizing the moment characteristics of a preset shape to demonstrate the eﬀectiveness of these designs. The stated parameters, convergence time, errors, motion characteristics, and length of the path, followed by the quadrotor, were compared for each of these design approaches, and a convergence time that was 46.77% shorter and path length that was 6.15% shorter were obtained by these designs. In addition to demonstrating the superiority of the designs, this study can be considered as a reﬂection of the realization, as well as the velocity constraints and disturbance resilience in the simulations.


Introduction
Quadrotors are at the top of the UAV list, and autonomy is their primary task. Visual servoing (VS) has shown significant success in assisting with autonomy while providing fault tolerance under GPS failure [1]. It requires features such as points, lines, shapes, or segments from the current image, and extraction mechanisms to obtain them [2]. After this extraction, the characteristics of these features, such as the coordinates in the image plane or the area of the contour, are presented by vector s. The difference between the requested feature vector s* and s is assumed to be the error vector, and this vector is deployed in the VS control law to obtain the control signals of the system in terms of linear and angular velocities. Image-based visual servoing (IBVS), the main VS approach, utilizes s gathered directly from the image, does not require pose estimation, and shows robustness against errors in depth prediction. The use of IBVS is more appealing in practical applications thanks to these benefits, and in this study, it serves as the VS method. Furthermore, as the camera configuration, the eye-in-hand configuration is assumed as the camera is attached to the center of the quadrotor.
The majority of IBVS studies focus on various feature-extraction techniques [3], camera geometry approaches and classes [4], hybrid VS approaches [5], or solutions to problems in IBVS , such as Jacobian matrix singularity or a missing field of view (FOV) [6,7], and the linear controller approach of VS is assumed to be the adequate controller, as the errors in the feature vectors exponentially decline. In addition, other performance indicators, such as the feature-convergence time, the velocity limits of the platform, the length of the path followed by the UAV, and the computational costs, are real-time metrics allowing for UAV applications to decrease their operation times while increasing their accuracy. The first use of VS for applications in UAVs was reported in [8]. A helicopter was assumed as an underactuated rigid body, and through the use of point features in the spherical image plane, the feature dynamics were included in the dynamic equations of the motion of this body. Nevertheless, the image plane disturbances were ignored. In a different study, the authors expanded this approach to include quadrotors with linear VS features [9]. Again, feature noise was disregarded as the authors only analyzed the noise in the quadrotor's attitude and torque signals. Although the use of spherical camera projection for VS is fairly common, the approach to quadrotor visual servoing in quadrotor control with spherical camera projection demonstrated that the issue of inappropriate maneuver characteristics in the Cartesian plane occurs with this configuration [10,11]. A quadrotor-stabilization system using an output-tracking-control approach with backstepping control and two-camera pose estimation was proposed in [12]. A VS framework employing features acquired from a unique spherical image projection was also presented [13]. Metni and Hamel focused on visual tracking for helicopters, and they proposed a system that makes use of the image data, an adaptive nonlinear-tracking-control law, and the homography matrix acquired using backstepping techniques [14]. The image noise was taken into account, but the authors did not provide the control, velocity signals, or velocities of the helicopter. Furthermore, the backstepping method was also used for autonomous landing on a moving ship [15] and to track a moving target [16]. A VS feedback controller based on homography was proposed in [17]. To confirm the desired equilibrium point and ensure that predetermined feature points remain inside the camera's FOV throughout the system's trajectory, they recreated attitude-and depth-ratio data. To present hover and landing control for a VTOL UAV on a moving platform, Hérissé et al. applied optical flow [18]. With the homography matrix generated from the gyro and the target's camera measurements, Plinval et al. suggested feedback laws for UAV stabilization [19]. To keep the target in the FOV throughout the task, Asl et al. devised an IBVS strategy for regulating the translational and yaw rotational movements of a quadrotor, which ensured robustness under uncertain conditions [20]. Thomas et al. proposed a virtual image plane, examined a cylindrical form in this plane, and used the obtained properties to propose a VS system that perched autonomously with an IBVS control law, considering quadrotor dynamics [21]. A VS control system based on nonlinear observers to estimate translational velocity and spherical features was proposed by Mebarki et al. for moving nonplanar point targets [22]. For the purpose of calculating the adaptive gain in the VS of a quadrotor to track moving targets, reinforcement learning, a popular deep-learning method, was also utilized [23]. The main objectives of each of these VS approaches are UAV stabilization, hovering, or autolanding, with visual feedback.
The sliding surface design of the conventional sliding mode control (SMC) is used by the linear controller law of IBVS, as detailed in the following section. A common approach to assigning an acceptable slope in conventional SMC is to define a slope that is neither overly large nor excessively small to avoid exceeding control restrictions, and vice versa, to define a slope that is both sufficiently large to reach the sliding surface and slide on this surface quickly. With IBVS, this involves choosing a gain that is sufficiently large to accelerate the convergence and sufficiently modest to avoid exceeding velocity constraints. Parsapour et al. proposed a kernel-based VS with a PI-type sliding mode to eliminate the tracking errors of a robot manipulator [24]. Liu et al. utilized a supertwisting SMC for a rivet-in-hole insertion system to provide continuous control inputs, exponentially decreasing the feature errors and the robustness against the manipulator errors and external disturbances [25]. Miranda-Moya et al. designed an adaptive SMC scheme for robustness against external perturbations while tracking image feature targets, but image noise and chattering in control signals were neglected [26].
This study proposed an IBVS system with five modified sliding surface designs for quadrotors using analytical techniques and fuzzy logic (FL). The basis of this study is the design approaches for the VS control of robot manipulators [27]. The first design made use of an FL-based linearly changing sliding surface. The impacts of gain on IBVS experienced by trials were utilized to construct the linguistic rules of FL. The inputs of the FL unit were the error and error derivative norms to model the error dynamics. The second design altered the linear sliding surface by utilizing the sliding surface design with fixed acceleration, providing time optimality. In the third design, a nonlinear sliding surface was assigned using a tangent hyperbolic function with a width parameter function. The fourth design added an integral term with fuzzy logic to increase convergence performance. The last design utilized a nonlinear time-varying function to design a nonlinear sliding surface. The VS system is simulated utilizing the moment characteristics of a preset shape to demonstrate the effectiveness of these designs. The stated parameters, convergence time, errors, and motion characteristics were compared for each of these design approaches. The velocity restrictions and disturbance resilience in the simulations can be considered mirrors of realization even though this study demonstrates the superiority of the designs.

The Proposed IBVS System with Sliding Surface Designs
VS, and IBVS, aim to minimize the errors of feature vector derived from the features where ( ) ∈ ℝ is the error vector and ( ), * are the current feature vector and the desired feature vector with zero derivatives, respectively. Changes in s depend on only camera motion. Furthermore, IBVS assumes that the camera is attached to a six-DOF system such as a robot manipulator with eye-in-hand configuration and ≥ . Instead of point features, image moments were preferred as the shape features for this study to more precisely define the target of the quadrotor. The contours of an image's form can be characterized using image moments � � , which are defined in two dimensions as where represents the image contour points' index, ( , ) are the contour points' coordinates, is the number of contour pixels, and , are the number of contour pixels' powers. To ensure robustness against shape-scaling, it is necessary to normalize these moments. The centered moments , which are normalized moments, are defined as follows: where the coordinates of the image centroid are defined as = / and = / . These moments in (2) and (3) can be used to create moments that provide scale, rotation, and translation invariance.
In quadrotors, 6 DOFs are controlled by 4 thrusters, resulting in underactuation of the vehicle. The linear motion in ( , , ) and rotation around the -axis, which results in 4 DOFs, were taken into consideration to relate each feature to a DOF. Please note that this is only acceptable under small roll and pitch maneuvers. When a planar target and the image plane are parallel, as illustrated in Figure 1, the definition of perspective projection moments with scaling for controlling 4 DOFs is as follows: where is the normalized area of the closed contour shape, * is the desired target area and * is the desired target depth with as the feature vector. ( , ) are the normalized image center coordinates and is the normalized shape orientation. The proposed IBVS system's feature vector is gathered from these features.
The interaction matrix is a matrix that represents the connection between the feature error vector and the image dynamics. The above-mentioned visual characteristics' interaction matrix is provided as in [3]: As shown in Equation (6), is equal to − × for these moment features [5]. As a result of the chosen 4 DOFs, the terms of � , � in velocity vector were omitted in Equation (6). Furthermore, as a physical limitation of quadrotors that are underactuated systems, this definition is only valid when the quadrotor avoids aggressive maneuvers [10]. After the interaction matrix representation, the relation between the error and the vehicle velocities was obtained using Equations (6) and (1) with fixed desired features, as follows: ̇= .
IBVS utilizes a differential equation to exponentially reduce the feature error.
From a different perspective, this differential equation serves as the primary equation to assign a sliding surface in conventional SMC. Considering the errors, their derivatives and the system degree, conventional SMC specifies a surface, and it attempts to maintain the states of the system by equalizing the surface to zero. Under this concept, SMC and IBVS exhibit a close relationship. IBVS defines a kinematic velocity controller and is defined for quadrotors with the Moore-Penrose pseudoinverse of the estimated interaction matrix + , which is the same as itself and the gain using Equation (1) and (6)-(8) as: The IBVS controller for quadrotors in Equation (9) has drawbacks, such as a long convergence time with fixed gain or sudden change in the initial velocity values. The sliding surface designs were deployed in the proposed system to avoid these drawbacks. The proposed IBVS system with sliding surface designs is shown in Figure 2 and the sliding surface designs are defined in detail in the following subsections.

Fuzzy Logic for Linear Varying Sliding Surfaces
The IBVS system proposed in this study aimed to achieve three VS control performance measures. The first one is the feature convergence time, which is a measure of the time interval for the stabilization or autolanding of a quadrotor according to the visual feature errors [28]. The quadrotor's velocity restrictions should be taken into account in addition to aiming for success in this measure. A commonly used technique in SMC involves modifying the sliding slope in response to the system error states to achieve the desired objective while ensuring that the control signal remains within specified limits. The sliding slope is the only design parameter in Equations (8) and (9), and an online tuning algorithm was proposed, using the varying sliding slope approach. Instead of utilizing a complex analytical technique that has to be fine-tuned to account for soft parameter transition and makes use of numerous parameters to establish a parameter, FL can be a suitable option to add linguistic meanings and user experience to the design while also avoiding the requirement for repetitive tuning. The IBVS velocity controller in Equation (9) was modified as in Equation (10): should be dependent on (‖ ‖, ‖ ‖/ ), which determines VS velocity profiles. The rule base of the FL unit was specified in accordance with gain scheduling behaviors, which result in low velocities when there are high values of (‖ ‖, ‖ ‖/ ) and vice versa. The rule members of this rule base are defined by considering the trials and user experience that have been described in [29]. The evaluation of surfaces relies on multiple factors to determine the relationships between inputs and outputs. These are the types of membership functions (MF) utilized for the signals, the method of aggregating MFs, the rule base, and the type of defuzzification. Mamdani, as the type of FL unit used in this study, utilized fuzzy MFs as the output functions. The input-output MFs were Gaussian and generalized bell type. The aggregation type was the maximum of MFs, and the centroid of area (COA), the type of defuzzification, was the weighted average of the centroids of the output MFs with weighting factors of the input MFs and rules.

Fixed Accelerating Sliding Surface with Time Variation
In ref. [30], Bartoszewicz proposed a sliding mode approach with time optimality for the robust control of second-order uncertain systems. This optimality provides an adaptation of the system to the zero initial conditions that are essential for an IBVS system. A sliding slope term with time variation that was added to the classical sliding surface was defined as a function of time and was active during a predefined time interval. Bartoszewicz also proposed two sliding surfaces that have fixed acceleration and fixed velocity, which are defined by their time dependency. Compared to the conventional sliding surface, the sliding surface with fixed acceleration under time variations offers a higher error convergence; hence, this design was selected. Fixed accelerating sliding surfaces with time variation, parameter definitions, and an IBVS control law are given in Equations (11)-(13), respectively: where is the initial error constant, is the time limit for fixed acceleration, and , and are second-order time polynomial coefficients.

Nonlinear Sliding Surface with Tangent Hyperbolic Function
The first two designs' sliding surfaces are linear; therefore, the error states will always try to reach a constant sliding slope. The sliding surfaces with linear variations or time variations may reveal piecewise linear surfaces. To shorten the reach and slide phases, it is possible to employ a nonlinear function as the sliding surface function, as an alternative to the conventional linear approaches [31]. Tangent hyperbolic functions are strong nonlinear mapping functions and were chosen as the candidate in this study. In Equation (14), the error dynamics are defined using this nonlinear function as follows: where is the parameter for sliding magnitude that denotes the convergence rate and represents the nonlinear surface's sliding slope. These parameters might be set to fixed values; however, to reach the sliding surface more quickly, is selected as a function of error. The velocity signals of VS with this design are defined as:

Fuzzy Logic for Integral Sliding Surfaces
The classical linear sliding surface design in Equation (8) is a PD-type sliding surface and an integral term was added to this design to increase tracking performance [32]. This term may be in effect for all error trajectories, or only when the errors fall within predetermined boundaries based on the limits of the control signal. This is to avoid the windup effect of the integral term. The integral sliding surface definition is given below: The main problem in this surface design is determining the appropriate gain values for � , �. According to the information provided in [33], FL is also suitable for this design. In this study, only the gain value for the integral term was assigned using FL as a function of ‖ ‖ . The FL characteristics were the same as those mentioned in the design of linear varying sliding surfaces with fuzzy logic. Equation (16) was reformulated for IBVS as:

Nonlinear Sliding Surface with Time Variation
As an alternative to nonlinear constant functions, as shown in Equation (14), nonlinear time-varying surfaces can be designed to shorten the reaching phase of the states. Exponential time-varying functions were proposed in the literature as the nonlinear time-varying sliding surface function candidates, and the design in [34] was chosen in this study as: where ( , , ) are the design parameters of the sliding slope and time constant of convergence, respectively. This function also included the initial values of error and error derivatives. This provided zero initial velocity signals for IBVS. The control law for IBVS is given as follows: After these design phases of the proposed system, the velocities were then applied to the quadrotor as indicated in Figure 2. The quadrotor's inner-outer loop PD controllers regulated each rotor's torque, and the quadrotor moved in accordance with its kinematics and dynamics. A new image was captured by the quadrotor's camera, completing the closed loop of the system presented in Figure 2.

Simulation Results
This study utilized MATLAB Simulink, Robotics Toolbox, Machine Vision Toolbox [35], Fuzzy Logic Toolbox, and CoppeliaSim (version 4.5.1) to simulate and animate the proposed IBVS system with the sliding surface designs. The quadrotor model utilized here is the X-4 flyer, and more information about it can be found in [36]. It is considered that a camera with a downward FOV is fixed to the quadrotor's center without any kinematic transformation. The camera has a 1024 × 1024 pixel resolution, and the principal point coordinates are defined as (512,512) in the image plane. The system's control loop and video stream both operate at 20 Hz. The presumed center of the target shape, denoted as "H", is located at [−0.025 0.375 0] m. The closed contour of the target shape is obtained using Moore's neighborhood tracking method and that contour information was used to extract shape features. Figure 3 shows the animated scene of the scenarios created in CoppeliaSim. . ] m. The first performance metric is the convergence time, which is the time instant when ‖ ‖ < . . The second parameter, named the arc length, represents the length of the path followed by the quadrotor. This can be a good sign of the consumed energy and is calculated using the curve length formulation in vector calculus [38].

Classical IBVS with Fixed Sliding Slope
To compare each design, a conventional IBVS system using a fixed slope is considered as in Equation (9) and the slope is chosen as 0.35. Figure 4 illustrates the results of this conventional system. Figure 4a shows the quadrotor's trajectory, with the red circle representing the initial point, the blue circle representing the completion point, and the black circle representing the target center. Figure 4b shows the RPY angles of the quadrotor in the defined scenario. It is clear that there are no aggressive maneuvers and the limitation in Equation (6) is provided. Moreover, the velocity and error profiles are quite similar, as expected in Equation (6). The velocities and the errors in Figure 4c

Design 1: IBVS with Fuzzy Logic for Linear Varying Sliding Surfaces
To achieve fast convergence and low velocity profiles, a linear varying sliding slope design was presented as the first design. FL, also known as the key for the fuzzy sliding mode, is proposed to assign the slope value according to the error dynamics. The normalized error and error derivative inputs are applied to the FL unit. Mamdani is the type of FL unit and the input-output MFs are Gaussian and generalized bell type, as shown in Figure 5a-c. The aggregation type is the maximum of MFs and type of defuzzification is COA. The rulebase of the FL unit is also given in Table 1. The rulebase aims to provide a low gain while ‖ ‖ and ‖ ‖/ are high to avoid high velocities. Subsequently, the gain is increased to provide fast convergence while ‖ ‖ and ‖ ‖/ are low. Fine-tunings of membership functions and the rulebase are implemented by trial and error according to the nature of FL. The surface of the FL unit according to defined membership functions for input-output and the rulebase is shown in Figure 5d. This nonlinear surface is a result of nonlinear Gaussian and generalized bell input-output MFs. Here, it should be noted that is limited between 0.33 and 0.68.   remains constant and low between 0 and 1.5 s, since the error and error derivative norms are high, as in Figure 6a. Then, the FL unit is activated by error and error derivative norms and the varying sliding slope shows a nonlinear characteristic without discontinuity. Again, it remains constant and high after norms are small with small fluctuations after 6.2 s. These fluctuations are consequences of noise affecting the features. They are also obvious in the velocity signals of the quadrotor in Figure 6d, which may result in aggressive maneuvers.  The convergence time is 12.95 s. and the arc length is 1.8009 m. The design demonstrates faster convergence, as expected. However, it is worth noting that the arc length is slightly longer due to the varying sliding slope.

Design 2: IBVS with Fixed Accelerating Sliding Surface with Time Variations
This design added a new sliding slope term as a function of time, which can be active for a predefined time interval in Equations (11) and (12). Constant accelerated sliding was also chosen in this design. and T are defined as 0.22 and 2 by trials, respectively. The results of this design are shown in Figure 7.  In Figure 7a,c, the effect of the constant acceleration term is quite clear. The impact of the initial conditions of the velocity signals is significant, particularly when they deviate considerably from zero. This method aims to reduce these effects specifically within the time range of 0-2. The quadrotor follows a different path and shows different velocity patterns after this term is disabled. The sudden change in velocities at 2 s is very dramatic; however, again, it is compensated by inner loop controllers. Here, it should be noted that increases of 2-3.5 s are caused by the dragging force of the time optimal sliding surface but IBVS gathers itself up.
This design also provides a faster convergence with a 9.05 s. convergence time. The arc length is 1.6269 m, which is the shortest one among the designs.

Design 3: IBVS with Nonlinear Sliding Surface with Tangent Hyperbolic Function
Nonlinear sliding surfaces may shorten the reach phase and convergence time. The tangent hyperbolic function in Equation (14) with error norm dependency is defined as Here, it should be noted that can be chosen as a function of time [31]. The results of this design are shown in Figure 8.
The results in Figure 8 show that this design forces the IBVS system to converge more rapidly; however, the velocity limits do not allow for this. In Figure 8c, the signal in blue starts above the velocity limit of 1 m/s. Moreover, it is observed that the magnitudes of the negative peaks in velocities and errors are larger in comparison to the other approaches. This suggests that the nonlinear surface causes the features to drag from the desired target. In contrast, the observed convergence time is approximately 12.65 s, a value that closely aligns with the expected result of the linear varying surface design. The arc length is 1.97 m, which is a consequence of larger velocity and error magnitudes.

Design 4: IBVS with Fuzzy Logic for Integral Sliding Surfaces
The integral sliding mode with FL in Equation (17) was proposed to increase tracking performance and the results are shown in Figure 9.
is assigned as 0.35 and − uses ‖ ‖ as input. Again, the type of the FL unit of − is Mamdani and two Gaussian membership functions are defined for both input and output with the surface shown in Figure 9a.  Figure 9b and it is clear that it approximates to nearly zero to avoid the integral windup while the errors and the error norm are observed to be very close to zero, as shown in Figure 9f. The velocity signals show abrupt changes in the first 4 s in Figure 9e. Fortunately, they are filtered effectively by the inner loop dynamic controllers of the quadrotor.
The convergence time for this design is 17.3 s. This is worse than the classical approach. It is clear that the integral term forces fast convergence with high velocities. Please note that relying only on the integral term is inadequate to achieve a fast convergence in the VS system. The arc length is also 1.83 m., indicating a reduction in comparison to the previous design.

Design 5: IBVS with Nonlinear Sliding Surface with Time Variation
An alternate approach to nonlinear sliding surfaces involves changing the nonlinear function as a function of time. An exponential function defined in Equation (18) is defined with , and values as 0.3, 0.2 and 2, respectively. The results of this design are shown in Figure 10.
The path in Figure 10a is very smooth and the RPY signals are quite realizable. Again, signal in blue starts with saturation for a short time interval. In Figure 10c, it is also clear that the nonlinear time-varying design provides zero initial velocities, which are essential for realization. Furthermore, the system behaves like the classical system after the nonlinear term is disabled after 2 s in Equation (18).
The convergence time is 8.65 s, which is the shortest among the designs. However, the arc length is 1.8237 m, which can be assumed to be the average.

Conclusions
While new studies try to adapt kinematic controller approaches of vs. to UAV applications, sliding surface designs may provide expert help in the field of nonlinear control. In this study, five different sliding surface designs with analytical and intelligent methods are modified and an IBVS system with these designs for quadrotors is proposed. The designs are compared according to the convergence time, arc length, and motion characteristics under feature disturbances. The issues in realization, such as initial velocity values, are also discussed. A comparison of the designs is given in Table 2. According to the convergence time metric, it is evident that all designs perform better than the classical Errors e x e y e a e approach except the integral sliding surface with fuzzy logic. The best one is the fifth design, the nonlinear sliding surface with time variations, which is 46.77% shorter than the classical approach. The best one according to the path length, which can be a good marker of the energy consumed by the quadrotor, is the second design, the time-varying sliding surface with a fixed acceleration that is 6.15% shorter. In contrast, this solution activates the constant acceleration term within a specific duration, resulting in sudden changes in the velocity signals. However, the inner loop controller effectively mitigates this undesired effect. According to motion characteristics, Designs 1 and 4 also have the potential for aggressive maneuvers. It is important to note that parameter tuning is a necessary aspect of all designs, which is a function of experience. As a limitation of Equation (6), the quadrotor must show soft maneuvers and these are provided in all designs with small roll and pitch angles. The computational costs of all designs are advantageous for embedded on-board UAV systems considering the perspective of realization. The use of FL units may potentially result in a bottleneck when deploying a UAV with limited computational capacity, such as the STM32. Moreover, it is worth considering the use of AI structures such as ANFIS, which combines NN and FL, as an alternative to FL units. This approach may have the potential to enhance the performance of designs in a more effective manner. In future studies, it is planned to realize the proposed sliding surface designs on a real quadrotor that is controlled by visual servoing. Furthermore, the study utilizes point features. Using shape features, the features of an AR code, a popular marker in the field of VS, may be more attractive. Besides these sliding mode designs, modifications to nonlinear time variances and terminal sliding mode will be addressed and tested to enhance the number of designs. Additionally, all the designs will be tested after adding a type of Kalman filter while tracking moving feature targets.