Ijret - Implementation of Pid Control To Reduce Wobbling in A Line Following Robot
Ijret - Implementation of Pid Control To Reduce Wobbling in A Line Following Robot
Ijret - Implementation of Pid Control To Reduce Wobbling in A Line Following Robot
M.Tech Student, Department of Mechanical Engineering, SRM University, Chennai, India, ace.anirudh@gmail.com B.Tech Student, Department of Telecommunication Engineering, SRM University, Chennai, India, armsr92@gmail.com 3 B.Tech Student, Department of Mechatronics, SRM University, Chennai, India, tarunmalik29@gmail.com
Abstract
A Proportional-Integral-Derivative (PID) Control System provides for controlling the value of a variable, in this case the position of the robot, so that it is at or near a desired value, called the set-point, in this case on the centre of the line. In contrast to other control systems this provides for the smoothest type of control with minor deviations and overshooting if implemented correctly. This paper discusses, the concept, design and implementation of a line following robot that uses the PID control algorithm to govern its motion. The control algorithm is implemented in real time by a pre-programmed microcontroller.
2. ROBOT CONSTRUCTION
The robot consists of the hardware (the tangible components) and the software (the control logic that runs on the microcontroller which guides the motion of the robot. The major sub-systems of the line following robot and their interactions are shown in Figure 1. The environment is defined as the surroundings of the robot, with which the robot interacts with the use of its actuators. The robot in turn can learn about its surroundings in real time with the use of its sensors that convert physical parameters of the environment in to electrical signals that can be understood by the microcontroller. All of these sub-systems are essential to the functioning of the robot. Furthermore they must be seamlessly integrated together for perfect functionality.
__________________________________________________________________________________________
Volume: 02 Issue: 10 | Oct-2013, Available @ http://www.ijret.org 531
The bigger problem was to develop an algorithm that would allow the robot to follow the line smoothly even at high speed. The solution to this is to implement the PID control algorithm to control the motion of the robot.
2.3 Actuators
The actuators in this robot are brushed DC motors with a reduction gearbox that operate at 60 RPM and have sufficient torque to carry the robot. They are directly connected to the wheels of the robot and cause the robot to move in the desired direction. We have two motors controlling the two wheels. Motion is achieved using the concept of differential drive. Thus we can achieve motions of moving front, back and turning left and right. The motion is controlled from the microcontroller. The two motors are used to drive the robot using the concept of differential drive. In this the speed and direction of rotation of the individual wheels are used to both move and turn the robot.
Fig -2: Comparison of robot with and without PID following a line
__________________________________________________________________________________________
Volume: 02 Issue: 10 | Oct-2013, Available @ http://www.ijret.org 532
This is basically used to tell that the output given by the algorithm is not sufficiently changing the value of the error and the output given needs to be varied more drastically to reduce the error value. This is done for both positive and negative errors.
This component prevents the overshooting of the robot from the line when correcting the error. This means that when the error is reduces it stops the robot from moving so that it does not continue its motion to produce error by moving to the other side of the line.
4.3 Error
This is the difference between the Target Position and the Measured Position. So the more far away the robot will be from the Target position, the more the value of the error. The magnitude of error depends on which side of the line the robot is in. This also has positive and negative values.
A high proportional value would require a large change in the output value, to correct the error.
__________________________________________________________________________________________
Volume: 02 Issue: 10 | Oct-2013, Available @ http://www.ijret.org 533
PID can be further improved by increasing the number of sensors, which would cause the robot to go faster at curves and follow it more efficiently. The reason to this is that at curves the corner sensors will sense the line and proportionally are able to come back to the line, whereas for lesser number of sensors the robot may just come off the line.
CONCLUSIONS
Before using the PID, the problem we faced were that the robot did not follow the line smoothly. It wasnt efficiently following the line, so to improve this we implemented the PID logic. We started with implementing the proportional part, and wrote down the code for it. After running the robot we noticed that while following the wobbling of the robot was lesser than before, but it was still a big issue. We then added the integral part to the code, and the robot was now following the line much more efficiently with very less wobbling. The line following was further improved after adding the differential part to the code, which reduced the overshooting of the robot while trying to return to the line. The robot developed and used for testing by us is shown in Figure 3. While implementing PID, we faced a major problem in setting up the constants for the Proportional, Integral and Differential. We started by setting each value as 1 and then made the changes by either increasing it or decreasing it, and seeing the changes in the behavior of the robot. The constants had to be changed to many times before arriving at the perfect values. After setting up P constant, and setting the Integral Constant, even the P constant had to be varied a little.
Then we calculated the error value as Error = Measured Value Target Position A higher error value tells us that the robot is farther away from the line, than a lower error value. We then set the integral value as sum of current integral value & the error. The derivative value was updated to the sum of current derivative value & the last error. We then calculated TURN Value as the sum of the product of ERROR Value & the Kp constant, product of Ki constant and integral and the product of Kd constant & the derivative. We then give the output to the left wheel and the right wheel as a PWM (Pulse Width Modulation) output, which directly controls the speed of the motor. LeftPWM = Tp + TURN RightPWM = Tp TURN This results in both the wheels moving at different speed, which depends on the sensor input and is computed above. At the end of the program we set the last error value as current error value. This algorithm keeps repeating in a loop to give an effective PID algorithm. The above explained computation happens many times in a second to give an efficient line following robot. Another essential part of a PID algorithm is the setting of the PID Constants, that are Kp, Ki and Kd values. The best way to determine the perfect constant value would be to start from 0, and then look for the best output after continuously incrementing them. From the program execution, the robot first checks the sensor input, and calculates the error accordingly. The error value tells us how far our robot is from the line. Then the derivative is calculated which tells us how fast are we moving towards or away from the line. The integral is then calculated which sums up the distance from the lines edge. Using this TURN value is calculated which is added to the PWM values of the wheel.
REFERENCES
[1]. Electrical Power Systems by Wadhwa C L [2]. Modern Control Systems by Richard C Dorf and Bishop [3]. Robotics modeling planning and control by Bruno Siciliano, Lorenzo Sciavicco, Luigi Villani, Giuseppe Oriolo.
__________________________________________________________________________________________
Volume: 02 Issue: 10 | Oct-2013, Available @ http://www.ijret.org 534
BIOGRAPHIES
Anirudh is currently pursuing his M.Tech in Robotics from SRM University, Chennai. His area of interest is AI and Robotics
Aravind is currently pursuing his B.Tech in Telecommunication Engineering from SRM University, Chennai. Area of interest is Robotics and Networking. Tarun is currently pursuing his B.Tech in Mechatronics from SRM University. His area of interest is Robotics and Machine Learning.
__________________________________________________________________________________________
Volume: 02 Issue: 10 | Oct-2013, Available @ http://www.ijret.org 535