Hey, Welcome to the second Tutorial of Line following Robot. As In the previous Tutorial we have just covered the basics and important things for making Line following Robot.As In the previous tutorial I have just explained the best ways to make a line follower instead of choosing wrong components and wasting your time in extra activities we have to make it to the best effective and simplest. So always choose those things that are less time consuming but Effective. So before moving towards the next must Read the previous Tutorial about Line follower. I’m not going to explain the components of the basic concepts for line following.First Read this Tutorial:
Well in this Tutorial we will discuss the PID concept for Line following ROBOT.And I named it the modified PID algorithm.Before this intention, I was planning to write a tutorial about complete and complex line following Robots.But now I’m not going to do this.I have spent some hours surfing the internet about the PID line following Robots.And What I found is that there are already too many guides not just guides but a complex PID guides available for making Arduino code.They are not easy to modify according to the robot requirement.
Recently I have won the First prize in line following Robot competition.Later I will upload the video of the event in coming posts. My Robot Wins the Final Round and the amazing part is that I haven’t used any complex code. I just modify some points and skipped the complex part.Now my intentions for this tutorial is that I will only explain what I experienced and what is simple and effective.So we will just see the PID concept and adopt the best part in that for Line Follower. So here are the contents:
Necessary things for making line following Robot
Introduction PID algorithm
How to implement PID algorithm
PID Algorithm Parameters
Modify PID for line following Robot
Step: 01Necessary things for making line following Robot
As I have already explained how to make a smart line following Robot so we will not discuss each and everything again.And We have discussed the components list, What sensor do we need to use for smart and fast line following robot and How motor and H-bridges work.Read these previous tutorials for Component selection and how the code and sensor work in the line following Robot case.
I have recommended IR modules sensor for making a line following Robots.The QTR Pololu sensor array will work perfectly good but again I will recommend the separate modules sensor for making line followers.By this, We have more choices according to line width when we use separate sensors.But if you feel more comfortable with QTR sensor array you can use it.The sensor array is expensive but the results will be good.
The Proportional Integral and Derivative (PID) controller is the control algorithm and mostly used in industrial control. PID algorithm allows engineers to operate them in a simple and straightforward way. The name shows PID, The three words Proportional, Integral, and Derivative.
The Proportional Response:
The proportional component in PID algorithm is the difference between the set point of the system and the process variable. Now, this difference is called Error. Theproportional gain(Kp) is the ratio between output response and the error signal.
The Integral Response
Integral in PID is the sum of the error term over the time. If the result is a small error the integral component will increase slowly. Now the integral term will continually increase over the time unless and until the error is going to be zero, so the ultimate effect is driving the Steady-State error towards zero. The difference between the process variable and the set point is the Steady state error.
The Derivative Response:
The function of the derivative component is to decrease the outputof the process variable is going to increase. The derivative is the rate of change of the process variable. The Increase in thederivative time (Td)will make the system to react strongly and to make changes in the error term.This will increase the overall speed. The very small (Td) the derivative time is used in most practical systems.Derivative Response is sensitive and highly sensitive to the noise and in the process variable. If the feedback is noisy or the control loop rate is very much slower, The control system will be unstable due to derivative response.
Step: 03PID Control Algorithm for Line Following Robot
In a case when robot is deviated to left it then pushes to move towards right
In a case of deviation towards right, it is forced to move towards left
The accomplishment of this task gives a robot to follow the zigzag path.By this method, the speed we were giving was much less as error getting by using PID. And this technique was also not reliable for the turns. And To apply this algorithm it was better to use the error calculation method after calculating error giving motor it’s proportional value and then it changes speed and in turn, it gets back to the line.
e.g.-the deviation ranges between -3 to +3.
Kp is the proportionality constant it will give negative value when the robot is towards left of the line then the right motors gets slow down.Now, this is a good practical approach for many cases. But not suitable because of these reasons:
It affects the accuracy of the robot when the robot is not much effective it gets back to mean position very slowly.
To solve this problem we have to increase its proportionality contact but it will then overshoot when the robot comes to mean position due to inertia-cross to another side then again overshoot results in deviating result.
motorLSpeed = maxSpeed + correction; I know I just give some code snippets that will be really difficult to understand the whole concept.
Use this equation to control the speed of motors.Well here is just the PID understanding. Read this complete post about PID that I have written for PIC controller.See the post the code will help you to understand more about the concept.
Well, this tutorial is going to be more about PID. My intentions were to explain each and everything but the tutorial is going to be little lengthy so I will explain my code in the Next post. There are very few steps left to explain for a perfectly smart and fast line following Robot.
Stay connected and Subscribe to our YouTube Channel for video tutorials.