Publication

PID control of autonomous lline-following robot

View document

Bibliographic Details
Summary:This project aims to design and build an autonomous robot capable of precisely following a line in a complex environment. The main objective is to ensure reliable and autonomous tracking of a challenging path, providing both accuracy and motion stability. The robot is based on an ESP32 platform, equipped with five TCRT5000 infrared sensors arranged in a line to detect the lateral position of the line, and Hall-effect encoders on the wheels to measure the distance traveled and map the robot’s trajectory. The kinematic modeling of the differential-drive robot was performed in MATLAB/Simulink to validate expected motions, including straight paths with different initial orientations. The control system relies on a PID controller that adjusts motor speeds based on the error between the estimated line position (calculated using a weighted average of sensor readings) and the target position (center of the line). The control loop runs every 20 ms, providing fast and stable responses to disturbances. The code is modularized into distinct parts: sensor reading, encoder handling, PID control, motor driving, and odometry, which improves maintainability and clarity. Tests demonstrate that the robot successfully completes the map with near-perfect line following, although minor inaccuracies in trajectory plotting are attributed to encoder limitations. In conclusion, the project meets its goals of precise and autonomous line following, paving the way for future improvements such as odometry error correction and advanced navigation algorithms.
Main Authors:Mabrouk, Achref Ben
Subject:Robotics Line following PID ESP32
Year:2026
Country:Portugal
Document type:master thesis
Access type:open access
Associated institution:Instituto Politécnico de Bragança
Language:English
Origin:Biblioteca Digital do IPB
_version_ 1869469391034253312
author Mabrouk, Achref Ben
author_facet Mabrouk, Achref Ben
author_role author
contributor_name_str_mv Gonçalves, José
Biblioteca Digital do IPB
country_str PT
creators_json_txt [{\"Person.name\":\"Mabrouk, Achref Ben\"}]
datacite.contributors.contributor.contributorName.fl_str_mv Gonçalves, José
Biblioteca Digital do IPB
datacite.creators.creator.creatorName.fl_str_mv Mabrouk, Achref Ben
datacite.date.Accepted.fl_str_mv 2026-01-01T00:00:00Z
datacite.date.available.fl_str_mv 2026-06-23T11:05:56Z
datacite.date.embargoed.fl_str_mv 2026-06-23T11:05:56Z
datacite.rights.fl_str_mv http://purl.org/coar/access_right/c_abf2
datacite.subjects.subject.fl_str_mv Robotics
Line following
PID
ESP32
datacite.titles.title.fl_str_mv PID control of autonomous lline-following robot
dc.contributor.none.fl_str_mv Gonçalves, José
Biblioteca Digital do IPB
dc.creator.none.fl_str_mv Mabrouk, Achref Ben
dc.date.Accepted.fl_str_mv 2026-01-01T00:00:00Z
dc.date.available.fl_str_mv 2026-06-23T11:05:56Z
dc.date.embargoed.fl_str_mv 2026-06-23T11:05:56Z
dc.format.none.fl_str_mv application/pdf
dc.identifier.none.fl_str_mv http://hdl.handle.net/10198/36924
dc.language.none.fl_str_mv eng
dc.rights.cclincense.fl_str_mv http://creativecommons.org/licenses/by/4.0/
dc.rights.none.fl_str_mv http://purl.org/coar/access_right/c_abf2
dc.subject.none.fl_str_mv Robotics
Line following
PID
ESP32
dc.title.fl_str_mv PID control of autonomous lline-following robot
dc.type.none.fl_str_mv http://purl.org/coar/resource_type/c_bdcc
description This project aims to design and build an autonomous robot capable of precisely following a line in a complex environment. The main objective is to ensure reliable and autonomous tracking of a challenging path, providing both accuracy and motion stability. The robot is based on an ESP32 platform, equipped with five TCRT5000 infrared sensors arranged in a line to detect the lateral position of the line, and Hall-effect encoders on the wheels to measure the distance traveled and map the robot’s trajectory. The kinematic modeling of the differential-drive robot was performed in MATLAB/Simulink to validate expected motions, including straight paths with different initial orientations. The control system relies on a PID controller that adjusts motor speeds based on the error between the estimated line position (calculated using a weighted average of sensor readings) and the target position (center of the line). The control loop runs every 20 ms, providing fast and stable responses to disturbances. The code is modularized into distinct parts: sensor reading, encoder handling, PID control, motor driving, and odometry, which improves maintainability and clarity. Tests demonstrate that the robot successfully completes the map with near-perfect line following, although minor inaccuracies in trajectory plotting are attributed to encoder limitations. In conclusion, the project meets its goals of precise and autonomous line following, paving the way for future improvements such as odometry error correction and advanced navigation algorithms.
dirty 0
eu_rights_str_mv openAccess
format masterThesis
fulltext.url.fl_str_mv https://bibliotecadigital.ipb.pt/bitstreams/0518e0fa-60b3-4093-833e-e50c361ba52e/download
id ipb_85409dddf791b14efed5a6ed38eabd68
identifier.url.fl_str_mv http://hdl.handle.net/10198/36924
inst_facet_str urn:organizationAcronym:ipb{{{_:::_}}}Instituto Politécnico de Bragança
instacron_str ipb
institution Instituto Politécnico de Bragança
instname_str Instituto Politécnico de Bragança
language eng
network_acronym_str ipb
network_name_str Biblioteca Digital do IPB
oai_identifier_str oai:bibliotecadigital.ipb.pt:10198/36924
organization_str_mv urn:organizationAcronym:ipb
person_str_mv Mabrouk, Achref Ben
publishDate 2026
repo_facet_str urn:repositoryAcronym:ipb{{{_:::_}}}Biblioteca Digital do IPB
reponame_str Biblioteca Digital do IPB
repository_id_str urn:repositoryAcronym:ipb
service_str_mv urn:repositoryAcronym:ipb
spelling engporThis project aims to design and build an autonomous robot capable of precisely following a line in a complex environment. The main objective is to ensure reliable and autonomous tracking of a challenging path, providing both accuracy and motion stability. The robot is based on an ESP32 platform, equipped with five TCRT5000 infrared sensors arranged in a line to detect the lateral position of the line, and Hall-effect encoders on the wheels to measure the distance traveled and map the robot’s trajectory. The kinematic modeling of the differential-drive robot was performed in MATLAB/Simulink to validate expected motions, including straight paths with different initial orientations. The control system relies on a PID controller that adjusts motor speeds based on the error between the estimated line position (calculated using a weighted average of sensor readings) and the target position (center of the line). The control loop runs every 20 ms, providing fast and stable responses to disturbances. The code is modularized into distinct parts: sensor reading, encoder handling, PID control, motor driving, and odometry, which improves maintainability and clarity. Tests demonstrate that the robot successfully completes the map with near-perfect line following, although minor inaccuracies in trajectory plotting are attributed to encoder limitations. In conclusion, the project meets its goals of precise and autonomous line following, paving the way for future improvements such as odometry error correction and advanced navigation algorithms.application/pdfPID control of autonomous lline-following robotMabrouk, Achref BenGonçalves, JoséHostingInstitutionOrganizationalBiblioteca Digital do IPBe-mailmailto:dspace@ipb.ptdspace@ipb.ptURNurn:tid:2043179082026-06-23T11:05:56Z20262026-01-01T00:00:00ZHandlehttp://hdl.handle.net/10198/36924http://purl.org/coar/access_right/c_abf2open accessRoboticsLine followingPIDESP3216608816 bytesliteraturehttp://purl.org/coar/resource_type/c_bdccmaster thesis2026http://creativecommons.org/licenses/by/4.0/http://purl.org/coar/access_right/c_abf2application/pdffulltexthttps://bibliotecadigital.ipb.pt/bitstreams/0518e0fa-60b3-4093-833e-e50c361ba52e/download
spellingShingle PID control of autonomous lline-following robot
Mabrouk, Achref Ben
Robotics
Line following
PID
ESP32
status SINGLETON
subject.fl_str_mv Robotics
Line following
PID
ESP32
title PID control of autonomous lline-following robot
title_full PID control of autonomous lline-following robot
title_fullStr PID control of autonomous lline-following robot
title_full_unstemmed PID control of autonomous lline-following robot
title_short PID control of autonomous lline-following robot
title_sort PID control of autonomous lline-following robot
topic Robotics
Line following
PID
ESP32
topic_facet Robotics
Line following
PID
ESP32
url http://hdl.handle.net/10198/36924
visible 1