0% found this document useful (0 votes)
184 views13 pages

Make A FAST Line Follower Robot Using PID

This instructable discusses designing a fast line follower robot using PID control. The author initially built a simple robot with two IR sensors, but it did not follow lines well. To improve it, the author designed a new chassis, used more efficient components like brushless motors and an ESP32 microcontroller. A PID algorithm was implemented to make the robot's line following smoother based on sensor input. Testing showed the robot could navigate turns and intersections at up to 1 m/s. Further speed improvements may be possible through additional tuning and component upgrades.

Uploaded by

EZERR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
184 views13 pages

Make A FAST Line Follower Robot Using PID

This instructable discusses designing a fast line follower robot using PID control. The author initially built a simple robot with two IR sensors, but it did not follow lines well. To improve it, the author designed a new chassis, used more efficient components like brushless motors and an ESP32 microcontroller. A PID algorithm was implemented to make the robot's line following smoother based on sensor input. Testing showed the robot could navigate turns and intersections at up to 1 m/s. Further speed improvements may be possible through additional tuning and component upgrades.

Uploaded by

EZERR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

instructables

Make a FAST Line Follower Robot Using PID!

by the Technowright

Making a line follower robot is a great way to get started with robotics and arduino. But I had assumed it was a simple
project and never tried to make one. But when a friend of mine challenged me to join a line follower robot competition, I
had to design the fastest robot in the competition. On the day of the competition, my robot refused follow any line and it
was infact actively avoiding the line. My friend had won that challenge with his bot hitting a speed of 0.7m/s. So, I
decided to nd out where I went wrong and make a faster line follower robot.

Make a FAST Line Follower Robot Using PID!: Page 1


https://www.youtube.com/watch?v=QoNkpnpvEqc

Step 1: The Simple Version

I had to nd out where I went wrong. So I started by making a simple Line follower with two IR Sensors and arduino. It
works on the simple principle of a bang-bang controller. If the left sensor is on black then it turns right. And if the right
sensor is on black then it turns left. I rst tested it out using AA battery pack. But it wasnt delivering enough power. I used
a 12V LiPo battery. Then it worked.

Make a FAST Line Follower Robot Using PID!: Page 2


Make a FAST Line Follower Robot Using PID!: Page 3
Download
https://www.instructables.com/FTU/O3I6/LK6VM6ZK/FTUO3I6LK6VM6ZK.ino

Step 2: Designing the Advanced Version

I then designed a custom chassis to reduce the weight and make a design that is e cient. I replaced the DC motors with
N20 DC motors. I used an IR Sensor array instead of the 2 IR sensors. This is will be used to implement the PID controller. I
replaced the arduino with an ESP32 becasue it had Bluetooth which was very helpful while tuning the robot.

Make a FAST Line Follower Robot Using PID!: Page 4


Make a FAST Line Follower Robot Using PID!: Page 5
Make a FAST Line Follower Robot Using PID!: Page 6
Step 3: PCB Design

I then designed a PCB to incorporate all the elcetronics on a compact board. I used JLCPCB to manufacture the PCBs.
Also I the motor drivers I was using were wasting too much power as heat. So, I replaced them with the TB6612FNG
Motor driver Chip which is more e cient. And I and I used the PCB Assembly services from JLCPCB to get the chip
presoldered onto the board. You can download the gerber le(zip le) from https://github.com/theTechnowright/PID-
Line-Follower-Robot and upload it to JLCPCB to get them manufactured.

Make a FAST Line Follower Robot Using PID!: Page 7


Make a FAST Line Follower Robot Using PID!: Page 8
Step 4: Implementing PID Controller

Make a FAST Line Follower Robot Using PID!: Page 9


I then wrote the code for implementing the PID algorithm to make the Line Follower more faster and smoother. But,what
is PID? Well, it is a feedback loop which measures an error and uses it to actively correct its current position. In this case,
the 5 IR sensor array gives a value of how far away from the line the bot is and uses it calculate a steering value. If the
error is multiplied by a constant Kp. The steering value is proportional to the error. The greater the error is, the faster it
turns to correct it. But the steering value also depends on the constant Kp. A high Kp value will make turns fast and it will
oscillate. Whereas, a smaller Kp value will make the turns slow, and it will be lagging. This is explained well in the video at
4:50. I used a Bluetooth app to try out di erent Kp, Kd, Ki values. After spending hours I was able get the perfect set of
values. Now these values are uniqe for each robot.

Make a FAST Line Follower Robot Using PID!: Page 10


Download
https://www.instructables.com/FSV/A8BJ/LK6VMA3F/FSVA8BJLK6VMA3F.ino

Step 5: Speed Test

I built a huge track all around my living room oor to test the it. The track had 3 important parts which really test the
ability of the Line follower:
1. The 90° turn
2. The "Meanders"
3. Intersections

The results are include in the video @ 8:12. The bot was able to go through all three of these with quite an ease. I then
tested the speed of the Line follower by marking two points 1m apart and measuring the time taken. The max speed was
around 1m/s. The 3D Printed cover was making it quite heavy, and it was able to go faster without it. It stilll needs more
improvements to increase the speed. This could be by replacing the motors for a higher rpm dc motor, tuning the
algorithm better and by trying out di erent wheel diameters.

Make a FAST Line Follower Robot Using PID!: Page 11


Make a FAST Line Follower Robot Using PID!: Page 12
Make a FAST Line Follower Robot Using PID!: Page 13

You might also like