You are on page 1of 6

PSO TUNED PID CONTROLLER FOR

CONTROLLING CAMERA POSITION IN UAV


USING 2-AXIS GIMBAL
R J Rajesh Dr. C M Ananda
School of Electrical Engineering Senior Principal Scientist
VIT University, Vellore, CSIR- National Aerospace Laboratories
Tamil Nadu, India Bangalore, Karnataka, India
rajesh1790reddy@gmail.com ananda_cm@nal.res.in

Abstract— In this paper, camera gimbal control is designed well stabilized and noise free. This can be achieved only when
which controls the on board camera position used in UAV for the camera control is compensated for the vibrations, vehicle
various applications such as target tracking, Surveillance, Aerial attitude rate transients and gust. Controlling the camera
photography, autonomous navigation and so on. Traditional position is realized using gimbal mechanism having different
tracking systems are heavy and large to mount on small airframes.
control algorithms.
Gimbal with camera replaces traditional tracking systems and used
to capture aerial photography without video noise and vibrations. Gimbal is a mechanical device which consists of two or
So, the gimbal trajectory planning and its motion control are more rings mounted on axes at right angles to each other.
necessary. The controlling of camera gimbal is designed using Objects in unstable environments are kept in stable position
different controlling techniques which respond quickly without using gimbal device. They have wide range of applications in
excitation of damping flexibility. In order to develop the control, shipboard, aircraft environments and so on. Gimbals used in
kinematics is derived using different robotics techniques. In this aerospace applications consider Euler angles to orient the
paper PID controller is designed to control camera position using payload on it. In the application of aerial photography the
gimbal mechanism. PID control is the popular controller used in camera vibrates and shakes due to which image and video is
industries for its effectiveness, simplicity of design and its
not clearly captured. So, the camera position is controlled in
feasibility. PID consists of three tuning parameters which can be
tuned using different techniques. Manual tuning is not preferred order to make the camera movement is corrected and
since it is time consuming, tedious and leads to poor performance. compensated to avoid video noise due to vibration. The
Here, traditional tuning methods and evolutionary algorithms/bio- control which keeps the camera position corrected for
inspired algorithms are used to tune PID parameters. PSO is the stabilized video is called Gimbal control [2]. The camera
evolutionary algorithm used because of its stable convergence, gimbal can be controlled manually by a camera operator or it
dynamic and static performance, good computational efficiency due can be automated using control algorithms. In manual control
to which system performance with minimum errors can be independent camera operator and a pilot to navigate UAV are
achieved. In this paper, performance of system with conventional required. Here camera operator compensates the camera
PID and PSO tuned PID are compared and optimum solution is
gimbal for UAV body motion and communication between
implemented
pilot and camera operator is compulsory. In this type of
Keywords—UAV, Gimbal, PID controller,Particle Swarm control, multiple skilled technicians are necessary and
Optimization(PSO), Ziegler Nichols, Cohen Coon, Kinematics controlling becomes complicated. Whereas in automated
systems tracking software can be used along with different
I. INTRODUCTION control algorithms to control camera position without human
Unmanned Aerial Vehicle (UAV) is a type of aerial vehicle in loop [3].
which carries payload such as cameras and is governed by The goal of this paper is to design control algorithm for
onboard flight control system. It uses servo motors, sensors, controlling the camera position used in UAV using 2-axis
and transducers, communication equipments and so on to gimbal mechanism. The gimbal consists of servo motor,
control the movement of aircraft and its payload [1]. UAVs position encoder and inertial measurement unit (IMU). In this
have a wide range of applications in military, agriculture, application camera is mounted on gimbal and gimbal is
surveillance, aerial photography and so on. They are used to mounted under the aircraft frame at the front end [4]. This
perform missions such as surveillance, rescue operations camera control device is used for monitoring, object tracking,
during floods, earthquake disaster management etc. Many of to capture motion pictures, surveillance and so on, which uses
these applications require live video recording, video different control algorithms such as adaptive control, PID
transmission, tracking of moving objects and, surveillance for control, Fuzzy logic control etc., as compensators. If the
which image or video processing algorithms are necessary. camera is left uncompensated, it loses the target path or object
The primary requirement for such missions is that the video be and fails to meet the objective. To control the camera position,

978-1-4799-8371-1/15/$31.00 2015
c IEEE 128
gimbal actuators need to be controlled. The gimbal CAD The forward kinematics of gimbal is derived using
model for which the controller is designed is shown in Denavit-Hartenberg convention. The gimbal transformations
figure 1. [9] between the bodies are as follows.
The rotation matrix between the frame of body (0) and the
frame of body (1) is

§ cosș1 0 sinș1 ·
0
R1 = ¨ 0 1 0 ¸
¸ (1)
¨
¨ -sinș 0 cosș1 ¸¹
© 1

The rotation matrix between the frame of body (1) and the
frame of body (2) is

1
§ cosș 2 -sinș 2 0·
R 2 = ¨ sinș cosș 2 0¸
¸ (2)
¨ 2
Fig 1: CAD model of 2-axis Gimbal with camera as payload ¨ 0 0 1 ¸¹
©
In this application pitch-yaw axis movement gimbal
mechanism is used [5]. The movement of each axis is limited The total rotation matrix between the base frame (0) and
to +/- 90 deg. frame of body (2) is
II. MATHEMATICAL MODELLING
§ cosș 1 cosș 2 -cosș 1sinș 2 sinș 1 ·
The mathematical modelling of gimbal is necessary for 0
R 2 = ¨ sinș 2 cosș 2 0 ¸
¸ (3)
designing different control stratergies. In this application PID ¨
controller is designed [6]. ¨ -sinș cosș sinș 1sinș 2 cosș 1 ¸¹
© 1 2
A. Gimbal Modelling
The gimbal model consists of IMU sensor attached to
The 2-axis gimbal consists of two joints which rotate by camera frame (body (2)) and position encoders attached to
angles ș1 and ș2 along y-axis (pitch) and z-axis (yaw) servo motors. The angular position of body (2) with respect to
respectively. The gimbal shown in figure 1 consists of 3 body ground is derived from the gyros and accelerometers of IMU
frames (body (0) to body (2)). The link transformation attached to the body (2). Į1 and Į2 are the angles of pitch and
diagram is shown in figure 2. Here, in figure 2 X0Y0Z0, yaw axis of body (2) derived from the IMU. Į1desired and Į2desired
X1Y1Z1 and X2Y2Z2 represent as frames of body (0), body (1) represent the desired position of camera frame with respect to
and body (2) respectively. ground frame. ɂ1 and ɂ2 be the errors of pitch and yaw of
camera’s reference frame. Here, body (2) represents camera

frame.

İ1= Į1desired- Į1 (4)


ȣʹ
İ2= Į2desired- Į2 (5)
ͳ ʹ

The rotation matrix of camera’s error reference frame is


§ cosİ 1cosİ 2 -cosİ 1sinİ 2 sinİ 1 ·
ȣͳ 2 ¨ ¸
Ͳ R e = ¨ sinİ 2 cosİ 2 0 ¸ (6)
¨ -sinİ cosİ sinİ 1sinİ 2 cosİ 1 ¸¹
© 1 2

By the use of inverse kinematics the new joint angles are


Ͳ derived. The total rotation matrix between frame of body (0)
and error frame ɂ of camera’s reference frame is
0
R e (ș,İ)= 0 R 2 (ș) 2 R e (İ) (7)
Fig 2. Link frame assignment of gimbal

2015 International Conference on Power and Advanced Control Engineering (ICPACE) 129
Where, current joint angles are ș1 and ș2. C. PID Controller
0 The most commonly used controller in industries is PID
R 2 (ș new ) = 0 R İ (ș,İ) (8) controller. It contains parameters such as KP, KI and KD which
provides accurate closed loop performance where KP, KI, KD
The equation (8) represents that the frame of body (2) is same
are proportional, integral and derivative gains. The transfer
as error frame ɂ™‹–Š†‡•‹”‡†Œ‘‹–ƒ‰Ž‡•. From equation (7)
function of PID controller is shown in equation (14).
and (8) we can deduce equation (9).
KI
0
R 2 (ș new ) = 0 R 2 (ș) 2 R İ (İ) G PID =K P + +K Ds (14)
(9) s
The right hand side of equation (9) is expressed as III. CONTROL BLOCK DIAGRAM
§ r11 r12 r13 ·
0
R 2 (ș) R İ (İ)= ¨ r
2 ¸
¨ 21 r22 r23 ¸ (10)
¨r r33 ¸¹
© 31 r32
rij represents the components of matrix 0 R 2 (ș) 2 R İ (İ).The new
joint parameters are calculated using the equations (11) and
(12).
-r31
ș1new = tan -1 ( ) (11)
r11
ș 2new = sin -1 (r21 ) (12)
Ʌ1new and Ʌ2new are the new desired joint angles. Fig 4. Control block diagram of gimbal

The control block diagram for controlling camera


B. Motor Modelling
position using gimbal mechanism is shown in figure 4. Inv.
The dc motor transfer function equation to find position is position block gives the new joint angle calculated using
shown in equation (13). inverse kinematics of gimbal. PID controller is used as
position controller. The tuning of PID values is performed
ș(s) K using different tuning methods such as Particle Swarm
= (13) Optimization (PSO), Ziegler Nichols, and Cohen Coon
V(s) s[(Ls+R)(Js+B)+K 2 ] method and so on.
Where,
K represents emf in (Nm/A) IV. PSO TUNING METHOD
L is inductance in (henry) PSO is a type of evolutionary computation technique and is a
R is resistance in (ohm) population based robust stochastic optimization technique.
J is the moment of inertia of rotor in (kg.m2/s2) This method has shown its optima in solving problems
B is the damping ratio of mechanical system in considering nonlinearity, non-differentiability and so on. It
(N-m/rad) solves problems based on the movement and intelligence of
ȣሺ•ሻ is the angular position swarms [7]. PSO works as a searching algorithm which gives
ɘሺ•ሻ‹•–Š‡ƒ‰—Žƒ”˜‡Ž‘…‹–› optimum position. This algorithm was developed by the
inspiration of bird flocking. In this method, the solution is a
Also the dc motor block diagram is shown in Figure 3.This bird known as particle. The particles fly in the problem space
motor is the gimbal actuator whose position is controlled in of n dimensions (n is the no. of tuning parameters) by
order to control camera position considering current optimum particles. The PSO consists of
parameters such as swarm size, position, and maximum
V(s) K T(s) 1 Ȧ(s) 1 ș (s) number of iterations. Random initialization of its position and
+ velocity is performed. For every iteration, particle is updated
Ls+R Js+B s
− with two best values. One best value is the best solution
Armature Load achieved by individual particle so far known as Pbest and the
other best value is the optimum best solution obtained by a
particle in the entire population of particles called Gbest [8].
Vb (s) After obtaining the two best solutions the position and velocity
K of all the particles is updated using equations (15) and (16).

Fig 3. Block diagram of dc motor

130 2015 International Conference on Power and Advanced Control Engineering (ICPACE)
t+1 t t V. SIMULATION RESULTS
v i,m =w.v i,m + c1 * rand( ) * (Pbest(i,m) - x i,m )
The simulink model of camera gimbal control is shown in
t
+ c 2 * rand( ) * (G best(m) - x i,m ) figure 6. Here the IMU reading is taken as step input
(15) generated using stair generator block in simulink.
t+1 t t+1
x i,m =x i,m +vi,m (16)

Where,
i - 1, 2, 3…….n
m - 1, 2, 3.....d
n - Number of particle population in a group
d - Dimension of space (no. of tuning
parameters)
t - Current iteration value
vi, m - velocity of a particle I at iteration t
w - Inertia weight factor
c1, c2 - learning factors
rand ( ) - random no. between 0 and 1
Xi, d - current position of particle i at t iteration Fig 6. The simulink model of camera gimbal
Pbest (i) - best particle position of ith particle In this gimbal control model the IMU desired angles are the
Gbest - best particle position among all the set point to be achieved in order to make camera stable and
particles in the population point to desired object. The error given to PID controller is the
difference between the joint angle calculated by inverse
kinematics of gimbal and the joint angle obtained by position
The flow chart of PSO algorithm implementation is as shown encoder. The responses in figures 8, 9, 10 and 11show the
in Figure 5 [8]. joint angles obtained for achieving the set point.
A. Implementation of PID controller using Conventional
Tuning methods
The PID tuned values using Ziegler Nichols method and
Cohen Coon method is shown in Table 1. These tuning
methods are the conventional tuning methods.
Table 1: PID parameter values obtained using Conventional
methods

Tuning Proportional Integral Differential


method Gain (Kp) Gain (Ki) Gain (Kd)
Ziegler 5.376 0.49085 0.1227
Nichols
Cohen 17.78 0.7375 0.1090
Coon
0

Fig 5. Flow chart of PSO algorithm


Fig7:.Step responses of system for different tuning methods

2015 International Conference on Power and Advanced Control Engineering (ICPACE) 131
The responses of 2-axis camera gimbal of pitch axis and yaw (Population)
axis is shown in figure 8 and figure 9 No. of iterations N 1000
Minimum inertia Wmin 0.4
weight
Maximum Wmax 0.9
Inertia weight
Dimension (No. dim 3
of parameters)
The fitness function used in PSO algorithm is as shown in
equation (17). Selection of fitness function is crucial to get
better tuning values due to which system responses are
optimum. Here Ⱦ value is taken as 1.

F = (1- exp(-ȕ))*(Mp+Ess) + exp(-ȕ)*(Ts -Tr) (17)


Where, F is the fitness value, Ⱦ is the weighing factor, Ess is
the steady state error, Mp is the overshoot, Ts is the settling
Fig 8. Pitch axis response using conventional method time and Tr is the rise time.

The responses of PSO tuned PID controller for camera


gimbal control used in UAV are shown in Figure 10 and figure
11. Pitch and Yaw axis responses are shown which represent
the final joint angles obtained by position encoder.

Fig 9. Yaw Axis response of gimbal using conventional method

B. Implementation of PID controller using


EvolutionaryTuning methods
There are many evolutionary tuning methods such as ACO
(Ant Colony Optimization), PSO (Particle Swarm Fig 10. Pitch axis representation of gimbal using PSO tuning method
Optimization), and GA (Genetic Algorithm) and so on. In this
The responses clearly indicate the performance variation of
paper PSO algorithm is used. The implementation of PSO-PID
the system for different tuning methods used to tune the PID
is done according to the flow chart as shown in figure 5.The
controller parameters. PSO tuned PID controller gives the
PSO parameters used are shown in Table 2. better performance of the system. The system performance
Table 2. The PSO algorithm parameters depends on controller and its tuning parameter values.

Parameter Variable Value


Name
Cognitive c1 1.5
component
Social c2 1.5
component
No. of particles n 100

132 2015 International Conference on Power and Advanced Control Engineering (ICPACE)
[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. NagaBabu, Gudlavalleru engineering college,
Gudlavalleru, Andhra Pradesh, India, ”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] Anil Kumar, Dr. Rajeev Gupta, “Compare the results of tuning of PID
controller by using PSO and GA Technique for AVR system”,
International Journal of Advanced Research in Computer Engineering &
Technology (IJARCET) , Volume 2, Issue 6, June 2013.

[9] Manohar L R, C M Ananda, “Design, Simulation And Development Of


Two Axes Gimbal For Micro Arial Vehicle”, International Journal of
Electrical, Electronics and Data Communication, Volume-3, Issue-5,
May-2015.

Fig 11. Yaw Axis response of Gimbal using PSO tuning method

VI. CONCLUSION AUTHORS


The position control of camera in UAV is very important for AUTHOR 1
different applications as discussed. The PID controller
R J RAJESH pursuing MTECH in
designed keeps the camera stable as shown by the responses.
Control and Automation from VIT
Tuning methods used to tune PID parameters show different
variations in performance in the system as seen in simulation University, Vellore. He completed his
results. PSO tuned PID controller gives accurate and stable Bachelor’s degree in Electronics and
convergence. So, PSO tuned PID controller is preferred to Communication Engineering. He is
control camera position using gimbal mechanism. currently working on his master
thesis at National Aerospace
VII. AKNOWLEDGEMENT Laboratories under the guidance of
Authors like to thank Mr. Shyam Chetty, Director NAL for Dr. C M Ananda. His areas of
continuous support and motivation. Authors also like to thank Interests are optimal Control,
Mr. S.M.Vaiteeshwaran, Mr. Pavan and team of NALMETF Robotics and Control, process control, MEMS, Industrial
for their support in designing controller for controlling camera automation, Flight dynamics and control
position using gimbal mechanism
AUTHOR 2
VIII. REFERENCES
[1] Tiimus K & Tamre M, “Camera Gimbal “Control System for Unmanned Dr. C M Ananda holds PhD
Platforms”, 7th International DAAAM Baltic Conference (Engineering) in Avionics Embedded
"INDUSTRIAL ENGINEERING”, Tallinn, Estonia, 22-24 April 2010. Systems with Masters Degree from
[2] Ole C. Jakobsen and Eric N. Johnson, Georgia Institute of Technology, BITS, Pilani and Bachelors degree in
Atlanta, GA, “Control Architecture for a UAV-Mounted Pan/Tilt/Roll Electronics and Communication
Camera Gimbal”, InfoTech @Aerospace , Arlington, Virginia, 26 - 29 Engineering. He is Sr. Principal
September 2005.
Scientist and Head of Aerospace
[3] Taki Shiino, Kazuo Kawada, Toru Yamamoto, Manabu Komichi and Electronics and Systems Division at
Takafumi Nishioka, Department of Education, Hiroshima University,
Hiroshima, Japan, “Gimbals Control with the Camera for Aerial
National Aerospace Laboratories. He has 25+ years of
Photography in RC Helicopter” International Conference on Control, professional experience in the domain. His areas of interest
Automation and Systems in COEX, Seoul, Korea, 2008 Oct. 14-17, are- Integrated Modular Avionics, Flight Critical System,
2008 Embedded distributed system, Re-configurable avionics
[4] Mohammad Abdul Rahman Al-Mashhadani, Department of Information architectures and Safety critical software, reconfigurable
System and Technology, Belarusian National Technical University, platform, fault tolerance, avionics and systems health.
Minsk ,Belarus,” 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

2015 International Conference on Power and Advanced Control Engineering (ICPACE) 133

You might also like