Robot Controls Project Final Report
Robot Controls Project Final Report
I. I NTRODUCTION
Zt
τ = Kp q̃ + Kv q̃˙ + Ki q̃(σ)dσ (4)
v
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.
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.
Page 5 of 5