Gimbal Axes Control with PID Controllers

Gimbal is a system in missiles that allows the seeker to lock onto the target and follow it and increases the angle of view with its mobility in two axes. In this study, the control of the axes of a two-axis gimbal system used in the missile was carried out. PID controller tuned with Particle Swarm Optimization (PSO) is used in the control algorithm. In the optimization, a smoother controller is aimed by using the multi-objective objective function, which also includes the controller output with the position error. At the same time, the bandwidth of the system is also included as a constraint. The Butterworth Polynomial Method (BPM), which can adjust the coefficient according to the bandwidth criterion, was used for comparison purposes. As a result of the experimental studies show that the PID tuned with PSO can control the system with a lower positional error by responding faster to external factors than the PID designed with BPM.


INTRODUCTION
Unmanned aerial vehicles and missiles must work flawlessly in target finding and tracking to fulfill their duties.Different target-tracking methods are used in monitoring systems.One of these methods is camera systems using image processing methods [1,2].Locking and stabilizing the camera on the target is usually done with gimbal mechanisms.Gimbals typically consist of two or three axes and stabilize the sensor against vehicle disturbances [3].The stabilization process is complex due to the carrier systems' dynamic movements, sudden target maneuvers, and high speeds [4].
The axes of the two-axis gimbal are orthogonal to each other and have free movement capability.The camera or sensor system is located on the inner axis.Each axis is controlled by separate actuators, providing the torque and movement required for stabilization [5].Two methods generally achieve line of sight (LOS) stabilization.In the first, the angular velocity sensor is mounted on the LOS axis, thereby increasing accuracy by direct measurement.In the second, the angular velocity sensor is mounted on the base where the gimbal is placed.This method is called indirect LOS stabilization, which is complex because of unmeasurable distortions in the LOS framework [6].The main problems with gimbal systems are unbalance, cross-link and unmeasurable distortions LOS frame, and model ambiguities.Due to these uncertainties and distortions, different control methods have been tried in the literature [7,8].Some of the well-known techniques in this context in the literature are Sliding Mode Control [9,10] due to its fast response time and robustness, H∞ control [11,12], which can optimize different features of the system response together, Fuzzy Logic [13,14] due to adaptable to nonlinear systems and classical PID controllers that can be easily designed and implemented [15,16].
As in many industrial applications, PID controllers are frequently used in DC motor control due to their simple structure and easy application to different applications [17].Mainly thanks to the simple structure of PID, it can be easily integrated into embedded software applications.In this study, PID controllers were designed to control gimbal axes.Determining the coefficients in the design of control systems is both an important step and a serious problem.One solution is to use the classic methods to set the parameters.However, since the assumptions in these methods are usually error-focused, they cannot be effective in adjusting the requirements, such as bandwidth [18].For this reason, the first method preferred in this study was the Butterworth Polynomial Method.It is also seen that researchers use metaheuristic methods to optimize different control outputs simultaneously.In one study, the P and PI coefficients used for position and velocity loops were adjusted by the Particle Swarm Optimization (PSO) method [19].Similarly, in another application where PSO is used, the coefficients of the stepper controller consisting of PID and PI are adjusted to minimize the integral error of the primary loop [20].In another PSO application, a cascade controller consisting of PI and PD is set within the scope of speed control of the electric vehicle.A multiobjective cost function decreases velocity error and overshoot [21].Using these successful examples, PSO was used as the second coefficient adjustment method in this study.In the second part of the study, the gimbal's general view and the mathematical model of the axes are included.In the third chapter, control systems designs are given in detail.In the fourth chapter, there are experimental studies with the real gimbal system.

GIMBAL SYSTEM
The gimbal consists of two axes.It is called the outer axis (yaw axis) and the inner axis (pitch axis).The camera system is located on the inner axis.The picture of the gimbal used in the studies is given in Figure 1.

Figure 1. Gimbal System
DC motors drive the axes of the gimbal.Stabilization commands are generated separately for the pitch and yaw axes.These commands are applied to the DC motors from the control systems, and stabilization of the gimbal is performed.A feedback signal for stabilization is obtained with the gyro sensor in the gimbal [22].The representation of the stabilization process on a single axis is given in Figure 2 [23].

Figure 2. The stabilization process on a single axis
Parameters given in the diagram,   ,   ,   ,  ,  , and   (), respectively, show the total moment of inertia of the inner gimbal axis, the viscous friction coefficient between the outer and inner axis, the gain of the motor driver board, the stiffness of the inner axis cables, the motor torque constant and the controller transfer function.

Butterworth Polynomial Method
Some of the methods of adjusting PID coefficients in the literature are making adjustments by making predictions on the system input and response [24].Another way of determining the coefficient is to make calculations according to the appropriate bandwidth values by matching the system's transfer function with specific functions.One of these methods is the Butterworth polynomial method.In this method, it is possible to select the poles of the system in such a way as to provide the expected bandwidth from the control system [24,25].The third-order Butterworth polynomial is shown in the equation [22]: In the above equation, c  (= 2  ) represents the desired bandwidth value from the control system in rad/s.The closed-loop transfer function from   to   of the stabilization system given in Figure 2 is obtained as follows.
The inertia value for the inner axis is J=3.5E-5 and Kti=575E-8.For the outer axis, it is J=3E-6 and Kti=500E-8.The Kt value is taken as 0.021 from the motor datasheet.Within the scope of system requirements, fc=10 Hz.In the above equations, the motor driver gains Kvi as an unknown.In the calculations, Kvi=1 is accepted.The coefficients for the inner axis are calculated as follows, Kp=13.14, Ki=410, Kd=0.21 and the coefficients for the outer axis are calculated as follows, Kp=11.27,Ki=350, Kd=0.18.

Particle Swarm Optimization
PSO is a population-based optimization technique inspired by the behavior of herds.It is designed for solving nonlinear problems.It is used to find solutions to multi-parameter and multivariate optimization problems [26].The PSO is started with a bunch of random solutions, and updates are tried to find the optimum solution.The particle positions are updated at each iteration according to the two best values.First are the coordinates that provide the particle's best solution so far.This value is called "pbest" and is stored in memory.The other best value is the coordinates that provide the best solution obtained by all particles in the population so far.This value is the global best and is denoted by "gbest."After finding the two best values, particle velocities and positions are updated according to the equations given below [27].
+1 =    +   +1 In the equation, vi indicates the velocity of the i th particle, the learning factors c1 and c2, pbesti the best position of the i th particle, and gbesti the best position in the iteration.rand1 and rand2 are random numbers with a uniform distribution between [0,1].Using ( 6) and ( 7), the equations below were prepared to calculate the PID coefficients.
+1 =    +  1 * One of the strengths of PSO is the ability to optimize different parameters within the same algorithm.While constructing the objective function for optimization, the integral of the absolute value of the stabilization error is used.The integral of the controller output is also used in the objective function for performing the stabilization more smoothly.The objective function is given in equation ( 11).In addition, the optimization has a bandwidth constraint.Due to system requirements, it is necessary to obtain a bandwidth greater or equal to 10 Hz with the controller.The flowchart of the algorithm is given in Figure 3.

Figure 3. The flowchart of the algorithm
In the optimization studies, simulations were made with particles between 5 and 20 and the number of iterations between 10 and 100.The position responses obtained for the declination axis are given in the Figure 4.As can be seen from Figure 4, the increases made in the last try had no noticeable effect.Twenty particles and 50 iterations were considered sufficient for optimization.The coefficients for the inner axis are calculated as follows, Kp=86.1,Ki=91.8,Kd=1.24 and the coefficients for the outer axis are calculated as follows, Kp=80.7,Ki=91.1,Kd=1.44.

EXPERIMENTAL TESTS AND RESULTS
The stabilization command is generated separately for the yaw and pitch axes.Control systems apply these commands to the DC motors and stabilize the gimbal system.It is received from the gimbal with the feedback gyro sensor and transmitted to the control systems.The general block diagram of stabilization is given in Figure 5.

Figure 5. The general block diagram of the stabilization
A real-time test system was installed to test the control of the yaw and pitch axes.The control algorithm is located on the NI PXI system.Data from the gyroscope and kinematic calculations are also available on the same system.Yaw and pitch angles are transmitted to the gimbal by the host computer.The host computer is running in a Windows environment.The image of the experimental environment is given in Figure 6.

Figure 6. The experimental environment
Within the scope of the experimental studies, both controllers were integrated into the test system separately, and the position data of the gimbal axes were collected.Firstly, square wave commands were used to analyze the controller.Figure 7 shows the position responses of the yaw axis.

Figure 7. Position response of yaw axis
With the PSO PID controller, 40 ms rise time and 57 ms settling time were obtained, and no steady state error occurred.With the BPM PID controller, 26 ms rise time and 157 ms settling time were obtained, and a steady state error of over 20 millidegrees occurred.There is also a 11% percent overshoot.While calculating the coefficients with the BPM PID controller, the bandwidth value is taken as a basis.On the other hand, PSO PID tries to minimize the error while using the bandwidth value as a constraint.With the controller output parameter added to the objective function, it tends to lower outputs and prevents the controller from being aggressive.This situation provides smoother responses, especially for gimbals with uncertainties that cannot be modeled precisely.

Figure 8. Position response of pitch axis
In the pitch axis, 34 ms rise time and 54 ms settling time were obtained with the PSO PID controller, and no steady state error occurred.With the BPM PID controller, 28 ms rise time and 160 ms settling time were obtained, and a steady state error of 20 millidegrees occurred (Figure 8).There is also a 10% percent overshoot.As with the other axis, better results were obtained with PSO PID.When the results are compared, it is seen that different values are obtained for both axes.The pitch axis carries the camera, and the Yaw axis carries the inner axis with the camera.Due to balance errors and cross-coupling, the axes' loads are also different.Cable stiffness is also seen as an essential factor in the pitch axis.

Figure 9. Sinusoidal position response of yaw axis
The sinusoidal command was applied to the gimbal axes as a second test.Test results of the Yaw axis are given in Figure 9. Similar position responses were obtained with both controllers in this test, unlike the step command.BPM PID, which had overshoot and steady-state errors in previous tests, could successfully follow the reference applied in this test.The main reason for this difference between the two tests is the balance problem.With the sudden acceleration in the step command, the effect of the balance problem increased, and the BPM PID could only respond to this situation with oscillation for a certain period.In sinusoidal reference, on the other hand, the degree of the signal applied at each sampling time increases smoothly.In this way, the effects of disturbances such as balance and cable stiffness are also reduced on the system.

CONCLUSION
In this study, controller design and applications were made to control the axes of a two-axis gimbal system used in the missile.In gimbal systems, uncertainties such as cable stiffness, mechanical friction, and axial misalignment can cause different and unexpected disruptive effects on the axes.In this context, the designed PSO PID and PID coefficients are tuned based on position error and controller outputs.In real-time tests performed on the desktop, control was possible with no steady-state errors.With the Butterworth Polynomial method, which calculates the coefficient according to the bandwidth criterion, steady-state errors have reached 20 millidegrees.There were also overshoots of over 10%.This situation shows that the PID controller designed with the optimization method can be more effective for uncertain gimbal systems.There are differences between the simulation results in the 3rd section and the experimental responses.In the simulation, ambient noises, especially the gyroscope, are not modeled in detail.These factors are estimated to cause deterioration in control.In future studies, stabilization trials will be carried out by connecting the gimbal system to a test system that can move in three axes.