0% found this document useful (0 votes)
5 views

Robot Controls Project Final Report

This document presents a project on using a PID controller for path tracking in TurtleBot navigation, demonstrating its effectiveness in controlling the robot's steering. The authors discuss the methodology, including the use of ROS and Gazebo for simulation, and provide results from experiments that show how tuning PID parameters affects navigation performance. The project concludes that the PID controller successfully maintains low steady-state error and fast response times, with suggestions for future improvements in tuning and testing.

Uploaded by

r2896215
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Robot Controls Project Final Report

This document presents a project on using a PID controller for path tracking in TurtleBot navigation, demonstrating its effectiveness in controlling the robot's steering. The authors discuss the methodology, including the use of ROS and Gazebo for simulation, and provide results from experiments that show how tuning PID parameters affects navigation performance. The project concludes that the PID controller successfully maintains low steady-state error and fast response times, with suggestions for future improvements in tuning and testing.

Uploaded by

r2896215
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

TurtleBot Path Tracking using PID Controller

Nagarjun Vinukonda, Rishi Madduri, Rishabh Chadha, Vrushabh Desai

Abstract—An optimal control techniques well known in control


community is proposed i.e. PID controller to address the problem
of path tracking in autonomous vehicles. In this project we
propose PID controller for turtle bot Navigation in order to
determine steering control at each instant of time. This project
aims to demonstrate the the control performance when robot
attempts to follow a path.
Index Terms—PID Controller, simulation, gazebo, ROS.

I. I NTRODUCTION

There are multiple control methods available to control


robot which depends on application specific and path planning
done.
The robot controls field is exceptionally advance and grows
with more exiting new research. Many researchers have in-
vented interesting projects, for an instance, Khnissi et al,
implemented global asymptotic stability for robot tracking
tasks using Neural Network controllers while navigating mo-
bile robot [1]. Parra-Vega et al, have proposed a simple
decentralized continuous sliding PID controller [2].
All these experiments and ventures require a software (a) Front view (b) Top view
platform to develop and test for which a simulation tool called
Fig. 1: Turtlebot
Gazebo is used from ROS platform. ROS is widely used
framework in field of robotics for writing robust robot software
using a collection of tools and libraries that facilitate the end
II. L ITERATURE S URVEY
goal of robot control.
Turtlebot is a differential drive mobile robot that exists as The field of wheeled mobile robots has seen a dramatic rise
a personal robot kit with open-source software. The project in applications across multiple domains, in the last decade.
is intended to allow users to have an inexpensive means of Tasks and areas that can endanger human life can now be
exploring ROS, implementing control systems for learning and accomplished by these wheeled robots. However, a robust
for fun. In the absence of real hardware, the software that is control system is required to deploy these robots and ensure
generated for the Turtlebot in ROS can be used in the Gazebo, a safe human robot interaction. Chang et al. in [3] present a
later after testing in software, hardware implementations can simple way of implementing an adaptive tracking controller
be done. based on PID for mobile robot trajectory tracking. They apply
Path Tracking is a considerable problem in autonomous a classical PID approach for a path-following controller. They
industries taking over past few years for which many control have used a non-linear model of mobile robot kinematics to
methods for path tracking have been developed considering perform an accurate trajectory prediction. They construct their
the nonholonomic constraints of autonomous vehicles. PID control law based on Lyapunov stability and consists of a
has advantages that include robustness and simplicity for parallel structure PID controller with fixed gain. They also
which best choice of PID parameters are searched for different perform a computer simulation for a differentially driven non-
process models. In this project we are using closed loop ROS holonomic mobile robot.
Turtlebot as our Kinetic Model as shown in Fig.(1). It is In [3] Mayyahi et al. propose an optimal control technique
assumed that our kinetic Model (Turtle bot) moves without that addresses the problem of path tracking. They utilize a
slipping on a plane, that means there is a pure rolling contact Fractional Order Proportional Integral Derivative controller
between the wheels and the ground and also there is no lateral to control an autonomous ground vehicle. They track the
slip between the wheel and the plane. Its Kinematic analysis behavior of a predefined reference path. In their work, they
can be conducted by using Cartesian coordinates. design two such controllers. And utilize the input torque to
manipulate the vehicle to obtain path. In comparison with [4], In the above equations ur and ul are right and left wheel
[3] uses both Kineamtic and Dynamic model instead of just velocities, x and y are position coordinates of robot and θ̇ is
Kineamtic Model. To further optimze the FOPID parameters, angular velocity.
the authors of [4] use a particle swarm optimization algorithm. In the Fig.3 provided, it represents various subsystems that
Normey-Rico et al. [5] propose a robust PID controller for comprise the trajectory planning of an autonomous driving
path tracking. They use a linearized model for the mobile system and its controller. The desired position and velocity is
robot which consists of an integrator and a delay system. fed into the different controller (i.e. PID) as its input. Using
They have tested their PID controller on synchro-dirve mobile these inputs and feedback from the system, the controller
robot and have shown good performance. The paper by Luo produces an output signal that represents the force that must be
et al. [6] proposes a rule-based expert control PID algorithm. applied to the system (in the form of motor torque). The goal
It combines position error and error rate of change output to of this project is to demonstrate the effect that a controller
correct PID parameters. They perform simulation in MATLAB has when a robot attempts to follow a path, which will be
and prove an improved dynamic performance, adaptability and explained in detail below.
a better tracking function.

III. DYNAMIC M ODEL AND C ONTROL


Most indoor mobile robots do not move like a car. Our
Turtlebot is differential drive bot. There are two main wheels
of equal radius, each of which is attached to its own motor.
To construct a simple model of the constraints that arise from
the differential drive, let us assume a distance L between the
two wheels, and the wheel radius, r as shown in Fig.(2).

Fig. 3: Turtlebot Control Structure

IV. PID C ONTROLLER


The desired output for the mobile robot is its position while
applying position control which is a PID controller. An error
is calculated on the position when control is applied, and this
is used to compute a voltage that is sent to the motors, which
ultimately drives the motors toward a desired position. The
control law for a PID controller is listed below in equation
(4).

Zt
τ = Kp q̃ + Kv q̃˙ + Ki q̃(σ)dσ (4)
v

τ represents the torque, q̃ is the position error, q̃˙ is the


velocity error, and q̃(σ)dσ is the integral term obtained by
integrating, with respect to time and the position error term.
Kp, Kv, and Ki represent the proportional, derivative and
integral gains, respectively.
Fig. 2: The parameters of a generic differential-drive robot

While the robot is moving based on the observations, the


transition equations are:

ẋ = r/2 ∗ (ul + ur ) ∗ cos(θ) (1)

ẏ = r/2 ∗ (ul + ur ) ∗ sin(θ) (2)

θ̇ = r/L ∗ (ur − ul ) (3) Fig. 4: Turtlebot PID control diagram

Page 2 of 5
As shown in Fig.4, the PID Control block receives the 3) Derivative Error Kd:
desired position and desired velocity of the wheel. The goal It is the difference between the current node and previ-
of the PID block is to give the mobile robot the motor torque ous node. Where Dp is previous dtance to node.
required to achieve the desired position and velocity.
Note that the role of the integral component in a PID DD = d − Dp (7)
controller is to make the steady state error in the PD control
system go to zero and the role of the derivative component is to Similarly, error is calculated for orientation of turtlebot
dampen the response, acting similar to friction. As mentioned, while navigating.
the desired terms are received and are subtracted from the ac-
tual positions and velocities to create the position and velocity 4) Turn Angle:
errors. The calculated torques are fed into the TurtleBot block, It is the angle turned by the turtlebot to travel from
which produces the actual position and velocity for the system. point 1 to point 2

V. M ETHODOLOGY y2 − y1
φ = arctan (8)
A. Coding Libraries x2 − x1
We are using ROS(Robot Operating System) for TurtleBot3 VI. E XPERIMENTS
Navigation, Rviz for visualisation and Gazebo simulation tool. The below figure shows our results while navigating our
We are using C++ as our programming platform. turtle bot in Rviz. We used trail and end method for tuning
and we can tune further our PID parameters in order to reduce
B. Pseudo code: the error. In the figure we are navigating our turtlebot through
pentagon trajectory and the path followed by bot is visualized
Algorithm 1: General PID Controller implemenation in red color. Following the success of our simulation, we
deployed our PID Controller on a Turtlebot.
Generate a random start node
Set Goal node
Set orientation range w.r.t start node
Set initial Kp,KI,Kd values
while not reached goal: do
Calculate distance Goal position
Calculate change in angle
Multiply error to Kp,Kd,Ki and keep updating
end while
When Goal has reached:
Calculate error in orientation and set the angle

C. Working method:
We implemented a closed Loop PID controller for which Fig. 5: Turtlebot Navigation on pentagon path
both position and orientation tracking is done while navigating
the turtlebot3.
VII. R ESULTS AND A NALYSIS
1) Proportional Error Kp: We have navigated our turtlebot in a closed environment.
It is the Euclidean distance between goal position and The following are the results of our experiment. We have
start position. conducted our experiment into two parts: Single Goal and
Multi-Goal experiment.
q We have tuned our Kp , Kd , Ki values using trail and
d= (goalx − startx )2 + (goaly − starty )2 (5) end method. While Navigating our turtlebot in single goal
experiment, we set our initial Kp , Kd , Ki values as 0.1, 0.001,
2) Integral Error KI: 0.001 respectively and it resulted as Fig.6, where the error is
It is calculated by updating distance at each interval. decreasing with time, as well as linear velocity when reached
Where Dt is Total distance travelled. goal. We have tuned our parameters to Kp , Kd , Ki values as
0.3, 0.001, 0.0001 respectively and resulted Fig.7. Similarly
we have increased Kp , increased Kd and decreased Ki as
Dt = Dt + d (6) 0.5, 0.01, 0.0001 respectively and resulted Fig.8. As observed

Page 3 of 5
Linear.x is the linear velocity of turtlebot. Linear.x is the linear velocity of turtlebot.

Fig. 6: PID error vs time Fig. 8: PID error vs time

Linear.x is the linear velocity of turtlebot.

Fig. 7: PID error vs time

from graphs as the error decreases the time taken to reach the
goal decreases, therefore increase in velocity. Fig. 9: Position error vs time
In the second experiment, we kept multiple points as our
goal as shown in the video recorded. The graph Fig.9 shows
position error vs time. As there are multiple goals available, w.r.t time with our tuning parameters.
the error decreases with time when reached the goal and the
sudden spike in graph is due to started of new goal point, VIII. F UTURE S COPE AND C ONCLUSION
which is different from previous goal point. The PID controller was the most effective in terms of
The Fig.10 and Fig.11 shows the change in theta error w.r.t maintaining a small steady-state error and providing a very fast
time. As the robot follows straight path from start node to first response time. The addition of the integral controller helped
goal near start node, there is no change in error in angle (i.e. to reduce the steady-state error, as it sums small amounts of
the curve is flat), but as soon as the robot sets its goal to a new error over time and accommodates for them with corrections
point, the change in angular error decreases in both directions when they’ve become significant enough to require correction.

Page 4 of 5
R EFERENCES
[1] K. Khnissi, C. Seddik, and H. Seddik, “Smart navigation of mobile robot
using neural network controller,” in 2018 International Conference on
Smart Communications in Network Technologies (SaCoNeT). IEEE,
2018, pp. 205–210.
[2] V. Parra-Vega, S. Arimoto, Y.-H. Liu, G. Hirzinger, and P. Akella, “Dy-
namic sliding pid control for tracking of robot manipulators: Theory and
experiments,” IEEE Transactions on Robotics and Automation, vol. 19,
no. 6, pp. 967–976, 2003.
[3] H. Chang and T. Jin, “Adaptive tracking controller based on the pid for
mobile robot path tracking,” in Intelligent Robotics and Applications,
J. Lee, M. C. Lee, H. Liu, and J.-H. Ryu, Eds. Berlin, Heidelberg:
Springer Berlin Heidelberg, 2013, pp. 540–549.
[4] A. Al-Mayyahi, W. Wang, and P. Birch, “Path tracking of autonomous
ground vehicle based on fractional order pid controller optimized by
pso,” in 2015 IEEE 13th International Symposium on Applied Machine
Intelligence and Informatics (SAMI), 2015, pp. 109–114.
[5] J. E. Normey-Rico, I. Alcalá, J. Gómez-Ortega, and E. F.
Camacho, “Mobile robot path tracking using a robust pid
controller,” Control Engineering Practice, vol. 9, no. 11,
pp. 1209 – 1214, 2001, pID Control. [Online]. Available:
http://www.sciencedirect.com/science/article/pii/S0967066101000661
[6] Z. Luo and W. Li, “Tracking of mobile robot expert pid controller
design and simulation,” in 2014 International Symposium on Computer,
Consumer and Control, 2014, pp. 566–568.

Fig. 10: Angular error vs time

Fig. 11: Angular error vs time

In this project we have successfully implemented PID


control on turtle bot both on Hardware and Software. From this
experiment we have gained knowledge on ROS and its tools
and experience on hardware implementation. Project work was
distributed evenly among team members to ensure that each
individual was actively participating in group work. Through
tuning in experiment we found, increase in Kp , increase in Kd
and decrease in Ki will reduce error effectively as discussed
in class.
In Future we can work on to tune the gains and perform
more testing to ascertain the effect of the tuning on the steady-
state error, overshoot, and response time of the controller.

Page 5 of 5

You might also like