IEEE International Conference on Computer, Communication and Control (IC4-2015).
Camera Gimbal Stabilization Using Conventional
PID Controller And Evolutionary Algorithms
R J RAJESH1 Kavitha P2
VIT University VIT University
Vellore, Tamil Nadu, India Vellore, Tamil Nadu, India
rajesh1790reddy@gmail.com1 kavithaslvm@gmail.com2
Abstract: In this paper, control system is designed to is very important in military applications, civilian purposes
stabilize the camera gimbal system used in different air borne etc. So, the stabilization of camera is very much necessary for
systems for applications such as target tracking, surveillance, all these applications. For the development of camera gimbal
aerial photography, autonomous navigation and so on. This control system, control algorithm designing is necessary.
camera gimbal system replaces many traditional tracking
There are many algorithms such as adaptive control, PID
systems such as radar which are heavy and large to mount on air
vehicles. So, the stabilization of camera gimbal is very important controller, fuzzy logic controller, fractional order controller
to eliminate shakes and vibrations in photography, provides and so on. The controller used for this system is PID
accuracy in tracking moving target and so on. The control system controller. PID controller is the most commonly used
for this gimbal is developed using various control methods and controller in the industries for its effectiveness, simplicity and
algorithms to provide better and efficient performance with feasibility.
flexibility, accuracy and feasibility. PID controller is designed to The gimbal mechanism used for control of camera position
control camera gimbal due to its effectiveness, simplicity and is a mechanical device which is designed using the rings
feasibility. The tuning parameters of PID controller are tuned mounted on axes at right angles to each other. The objects
using traditional and evolutionary algorithms such as PSO and
present in unstable environments are arranged in stable
GA to provide better performance and accuracy in system
response. PSO and GA are used due to its dynamic and static position using this mechanical device [2]. Camera used in
performance, computational efficiency and so on. In this paper, aerial vehicles is mounted as payload for this gimbal device.
performance of system with conventional PID and PSO, GA PID controller controls the movement of this device which
tuned PID controllers are compared and optimized algorithm is indirectly controls on board camera. Gimbal has variety of
implemented. applications in aircraft environment, to maintain level of
measuring instruments with respect to ground and so on. In
Keywords— Gimbal, PID controller, Particle Swarm this paper, the controller maintains the camera position
Optimization(PSO), Genetic Algorithm (GA), Ziegler Nichols, horizontal to ground axis or world axis. Control of camera can
Cohen Coon, Kinematics be feasible by manual control, but it is complex and tedious
I. INTRODUCTION since it requires separate operator to control it [3]. So,
autonomous control is preferable than manual control. The
The main aim of this paper is to develop stabilized camera advantage of using gimbal control with a particular control
control system which is used in number of applications such algorithm is shown in figure 1.
as aerial photography, surveillance, missile tracking, and
autonomous navigation and so on. The camera control system The gimbal used to control is 3-axis gimbal which consists
is supported using a mechanical system known as gimbal of servomotor, IMU sensor [4]. It is mounted at the front end
system. This camera gimbal is used in moving carrier such as of the aerial vehicle below the vehicle as shown in figure 1.
UAV’s, MAV’s, helicopter [1] and so on for target tracking, The PID controller controls gimbal actuators which control the
rescue operations, to capture motion pictures. Disturbances movement of the camera.
caused for the system due to motor friction, unbalanced
aerodynamics, spring torque forces are compensated using this
electro-mechanical system. If the camera positioning is not Xw UAV
compensated or stabilized, it produces shakes in the video Yw
capturing, blurred images, and failure in object tracking and so Zw
on during aerial photography, autonomous target tacking etc.
So stabilization of camera is necessary for various
Target Image
applications. Camera Captured Image
Autonomous operations and tracking of moving target
without knowing its future position is a challenging task. The
applications such as tracking a moving target, surveillance etc
Yim
Xim
Zim
IEEE International Conference on Computer, Communication and Control (IC4-2015).
The rotation matrix of pitch axis from the frame of body
(2) and the frame of body (3) is
Fig 1: Schematic diagram of Camera Gimbal on UAV
2
§ cosθ3
sinθ3 · 0
In this application yaw-roll-pitch-axis movement gimbal R3 = ¨ 0
1 0 ¸
¸
(3)
mechanism is used. The defect in the design of gimbal device ¨
¨ -sinθ
The total rotation matrix between
0 cosθ ¸ frame (0) and
the base
frame of body (3) is© 3¹
may lead to the development of complex control algorithms 3
and performance criteria may not be achieved [5].
0
R 3 = 0 R1 1 R 2 2 R 3 (4)
II. MATHEMATICAL MODELLING
The designing of control algorithm requires the § C1C3 -S1S2S3 -C 2S1 C1S3 +C3S1S2 ·
mathematical model of gimbal device and its actuator [6]. 0
R 3 = ¨¨ C3S1 +C1S2S3 C1C 2
¸
S1S3 -C1C3S2 ¸ (5)
A. Gimbal Modelling ¨ -C 2S3 S2 C 2 C3 ¸
© ¹
The 3-axis gimbal consists of three revolute joints and it Here Ci=Cos (Ʌi) and Si=Sin (Ʌi).
has yaw-roll-pitch axis representation. Here Ʌ1, Ʌ2, Ʌ3
represent yaw-roll-pitch angles. The schematic diagram of The IMU sensor is mounted on the camera frame i.e. body
gimbal kinematics with 3 revolute joints is shown in figure 2. (3) and position encoders mounted to servo motors. The
YAW angular position of camera frame is derived from the gyros
and accelerometers on IMU mounted on it. α1, α2 and α2 are the
angles of yaw, roll and pitch axes of camera frame. α1desired,
α2desired and α3desired represent the desired position of camera
frame with respect to ground frame. ε1, ε2 and ε3 represent the
errors of yaw, roll and pitch axes of camera’s reference frame.
ε1= α1desired - α1 (6)
ROLL ε2= α2desired - α2 (7)
ε3= α1desired - α3 (8)
The rotation matrix of camera’s error reference frame is
§ C ε1C ε3 -S ε1S ε2S ε3 -C ε2S ε1 C ε1S ε3 + C ε3S ε1S ε2 ·
3
R ε = ¨¨ C ε3S ε1 + C ε1S ε2S ε3 C ε1C ε2 S ε1S ε3 -C ε1C ε3S ε2 ¸¸ (9)
PITCH
¨ -C ε2S ε3 S ε2 C ε2 C ε3 ¸
© ¹
Here Cεi=Cos (εi) and Sεi=Sin (εi).
Fig 2: Gimbal Kinematics with 3 revolute joints From the inverse kinematics of gimbal, new joint angles
Gimbal forward kinematics is derived by using DENAVIT- are derived. The total rotation matrix from frame of body (0)
HARTENBERG convention. The transformation from body to the error frame ɂ in camera’s reference frame is
0
(0) to body (3) is shown below R ε (θ,ε)= 0 R 3 (θ) 3 R ε (ε) (10)
The rotation matrix of yaw axis from the frame of body (0) θ1, θ2 and θ3 are the current joint angles. The new joint
to the frame of body (1) is angles of gimbal are calculated as shown in (11).
§ cosθ1 -sinθ1 0· 0
R3 (θnew )= 0 R ε (θ,ε) (11)
0
R 1 = ¨ sinθ cosθ1 0¸
¸
(1) The equation (11) indicates that frame of body (3) is same as
¨ 1
¨ 0 0 1 ¸¹ error frame (ɂ) of camera frame. From equation (10) and (11),
© equation (12) is obtained.
The rotation matrix of roll axis from the frame of body (1) 0
and the frame of body (2) is R 3 (θ new )= 0 R 3 (θ) 3 R ε (ε) (12)
§1 0 0 · The right hand side of equation (12) is represented as
1
R 2 = ¨ 0 cosθ ¸
-sinθ 2 ¸ § r11 r12 r13 ·
¨ 2 (2) ¨ ¸
¨ 0 sinθ cosθ 2 ¸¹
0
R 3 (θ) R ε (ε) = ¨ r21
3 r22 r23 ¸ (13)
© ¨r r33 ¸¹
2
© 31 r32
IEEE International Conference on Computer, Communication and Control (IC4-2015).
Figure 3 shows the control block diagram used for
designing the camera gimbal control system. PID controller
performance depends on its parameters which are tuned using
rij represents the components of matrix 0 R 3 (θ) 3 R ε (ε). The
different tuning algorithms such as Ziegler Nichols, Cohen
equations derived using inverse kinematics give the desired
Coon, PSO tuning, Genetic algorithm, ACO and so on. In this
joint angles as shown below.
paper PSO tuned PID controller performance is compared
-r12
θ1new = tan -1 ( ) (14) with GA tuned PID controller along with traditional tuning
r22 methods.
θ2new = sin-1 (r32 ) (15) IV. PSO TUNING METHOD
PSO is a robust stochastic optimization technique and is
-1 -r31
θ = tan ( ) (16)
3new developed by the inspiration of bird flocking. It solves
r33 problems based the movement and intelligence of swarms and
ȣ1new, ȣ2new and ȣ3new are the new desired joint angles. provides optima for problems with non linearity, non-
differenciality and so on. It is a searching algorithm which
B. Motor Modelling gives optimum and shortest position. Birds are known as
The transfer function equation of gimbal actuator to obtain particles and fly in the problem space of n dimensions (n is the
desired position using controller is equation (17). no. of tuning parameters) by considering current optimum
particles [7]. It consists of parameters such as swarm size,
θ(s) K position, and maximum no. of iterations with random
= (17)
V(s) s[(Ls+R)(Js+B)+K 2 ] initialization of its position and velocity. In this method, each
Where, particle is updated with two best values for every iteration
K represents emf in (Nm/A) with one best value being the best solution achieved by
L is inductance in (henry) individual particle so far known as Pbest and the other best
R is resistance in (ohm) value is the optimum best solution obtained by a particle in the
J is the moment of inertia of rotor in (kg.m2/s2) entire population of particles called Gbest. The particles
B is the damping ratio in (N-m/rad) velocity and position is updated by the following equations.
ȣሺሻ is the angular position
i,m i,m v t+1 =w.v t + c * rand() * (P
1 best(i,m) i,m -x t ) +
C. PID Controller c2 *rand()*(G best(m) -x t
)
i,m (19)
PID controller is the most commonly used controller used
in industries. Its parameters Kp, Ki and Kd provide accurate t+1 t t+1
x i,m = x i,m + vi,m (20)
closed loop performance and are known as proportional,
integral and derivative gains respectively. The PID controller Where,
transfer function is i - 1, 2, 3…….n
KI m - 1, 2, 3.....d
G PID =K P + +K Ds (18)
n - Number of particle population in a group
s
III. CONTROL BLOCK DIAGRAM d - Dimension of space (no. of tuning parameters)
t - Current iteration value
vi, m - velocity of a particle I at iteration t The flow chart of PSO algorithm implementation is as shown
w - Inertia weight factor in figure 4.
Start
c1, c2 - learning factors
rand ( ) - random no. between 0 and 1 Initialize particles with random
position, velocity, Pbest & Gbest
Xi, d - current position of particle i at t iteration
Pbest (i) - best particle position of ith particle Evaluate the fitness function for each particle
Gbest - best particle position among all the
IS
particles in the population Rotary
current fitness value of a No
Move to next
particle < its previous best particle check
Encoder
T
Pbest Yes
Position Gimbal
Controller Actuator Pbest = Current Fitness Value
Tnew
T Calculate current Gbest of all
Inv. particle
D IMU
Position
D _desired IS
No Global best fitness value
< Previous global best
Fig 3: Control block diagram of gimbal fitness value
Gbest Yes
Gbest = current fitness value
Update position & velocity of
particles
No IS
stop criteria met?
Yes
Parameter values = Gbest values
Stop
IEEE International Conference on Computer, Communication and Control (IC4-2015).
Fig 4: Flow chart of PSO algorithm
Fig 6: The simulink model of 3-Axis camera gimbal system
V. GENETIC ALGORITHM TUNING METHOD
The IMU desired angles are the set point angles to be achieved
Genetic Algorithm (GA) is a stochastic global search which makes camera stable and points to desired object. The
optimization technique which uses natural process of error to PID controller is the difference between the joint
evolution for finding optimal solution. It is similar to PSO angle calculated by inverse kinematics of gimbal and the joint
algorithm and here particles are considered as chromosomes. angle obtained by position encoder.
This algorithm starts with zero knowledge of correct solution
and depends on system responses to arrive at optimal solution. A. Implementation of PID controller using Conventional
GA consists of three steps and they are selection of parent Tuning methods
chromosomes [8], crossover of these parent chromosomes and The responses of the 3-axis gimbal system obtained using
the mutation to create new individual better than parents. The traditional tuning methods for tuning parameters of PID
procedure is shown in flowchart in figure 5. controller are shown in figure 7, figure 8 and figure 9.
Start
Initialize Kp, Ki and Kd
Evaluate the fitness function for each
particle/chromosome
Selection of Parent Chromosomes
Crossover between the parent
chromosomes using Arithmetic
Crossover
Uniform Mutation
Elitist Model
Fig 7: Yaw axis response using conventional tuning method
IS
No stop criteria met?
Yes
Parameter values = Best Solution
Stop
Fig 5: Flow chart of GA algorithm
The Simulink model of 3-axis Camera Gimbal control is
shown in figure 6. Here the IMU reading is taken as step input
generated using stair generator block in simulink.
Fig 8: Roll Axis response of 3-axis gimbal system
IEEE International Conference on Computer, Communication and Control (IC4-2015).
Fig 9: Pitch axis response of 3- axis gimbal system
Fig 10: Yaw axis response using Evolutionary techniques
B. Implementation of PID controller using The responses of PSO and GA tuned PID controller for
EvolutionaryTuning methods Camera Gimbal control show the final joint angle reading
PSO and GA evolutionary tuning algorithms are used in this obtained from position encoder.
paper. The PSO and GA parameters used for tuning PID
controllers are shown in table 1 and table 2.
TABLE I. THE PSO ALGORITHM PARAMETERS
Parameter Name Variable Value
Cognitive component c1 1.5
Social component c2 1.5
No. of particles (Population) n 100
No. of iterations N 1000
Minimum inertia weight Wmin 0.4
Maximum Inertia weight Wmax 0.9
Dimension (No. of parameters) dim 3
The fitness function or objective function used in PSO
algorithm and Genetic algorithm is as shown below. Selection
of fitness function is crucial for obtaining best solution of PID
tuning values. Here Ⱦ value is taken as 1.5.
Fig 11: Roll Axis response of system using evolutionary technique
F=(1-exp(-β))*(Mp+Ess)+exp(-β)*(Ts-Tr) (21)
Where, F is fitness value, Ⱦ is weighing factor, Ess is steady
state error, Mp is overshoot, Ts is settling Time and Tr – Rise
time.
TABLE II. GENETIC ALGORITHM PARAMETERS
Parameters Values
Population size 50
Maximum No of generations (iterations) 500
No. of tuning parameters 3
Mutation rate (Uniform) 0.3
Crossover Probability (Arithmetic) 0.8
Selection rate 0.5
The system responses obtained using evolutionary tuning
algorithms is shown in figures 10, 11 and 12.
Fig 12: Pitch axis representation of gimbal using evolutionary technique
The responses clearly indicate the performance variation
of the system for different tuning algorithms. PSO tuned PID
controller gives the better performance of the system
compared to other tuning methods. The system performance
depends on controller and its tuning parameter values. The
step response of gimbal system using different tuning
algorithms is shown in figure 13.
Fig13: Step responses of system for different tuning algorithms
IEEE International Conference on Computer, Communication and Control (IC4-2015).
VI. CONCLUSION
The Stabilization of Camera Gimbal is very important for
various applications in air borne systems and other systems as
discussed. The control system of gimbal plays crucial role in
these applications to get accuracy in performance. The PID
controller designed stabilizes the camera gimbal and improves
its performance as shown by the responses. Tuning methods
used to tune PID parameters show different variations in
performance in the system and PSO tuned PID controller
gives accurate and stable convergence. So, PSO tuned PID
controller is preferred to stabilize camera gimbal system.
REFERENCES
[1] Tiimus K and Tamre M, “Camera Gimbal “Control System for
Unmanned Platforms”, 7th International DAAAM Baltic Conference
"INDUSTRIAL ENGINEERING”, Tallinn, Estonia, 22-24 April 2010.
[2] Ole C. Jakobsen and Eric N. Johnson, “Control Architecture for a UAV-
Mounted Pan/Tilt/Roll Camera Gimbal”, InfoTech @Aerospace,
Arlington, Virginia, 26 - 29 September 2005.
[3] Taki Shiino, Kazuo Kawada, Toru Yamamoto, Manabu Komichi and
Takafumi Nishioka, “Gimbals Control with the Camera for Aerial
Photography in RC Helicopter” International Conference on Control,
Automation and Systems in COEX, Seoul, Korea, 2008 Oct. 14-17,
2008.
[4] Mohammad Abdul Rahman Al-Mashhadani, “Optimal and PID
Controller for Controlling Camera’s Position in Unmanned Aerial
Vehicles”, International Journal of Information Technology, Modeling
and Computing (IJITMC), Vol.1, No.4, November 2013.
[5] Per Skoglar,” Modeling and control of IR/EO-gimbal for UAV
surveillance applications”, Institution for Systemteknik, Sweden.
[6] Jakob Johansson, thesis on “Modeling and control of an advanced
camera gimbal”, Department of Electrical Engineering, Linkoping’s
university, Linkoping, Sweden.
[7] P. Ravi Kumar, V. Naga Babu, “Position Control of Servo Systems using
PID Controller Tuning with Soft Computing Optimization Techniques”,
International Journal of Engineering Research & Technology (IJERT),
Vol. 3 Issue 11, November-2014.
[8] Bindu R, Mini K. Namboothiripad, “Tuning of PID Controller for DC
Servo Motor using Genetic Algorithm”, International Journal of
Emerging Technology and Advanced Engineering, ISSN 2250-2459,
Volume 2, Issue 3, March 2012.