Skip to content

Arduino code for a 2WD line-following robot using PID control. Customize motor speeds and PID constants to achieve precise line tracking. Enjoy flexibility with optional 'if statements' control.

Notifications You must be signed in to change notification settings

WassimHedfi/PID_LineFollower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

PID_LineFollower

Embark on an Exciting Robotic Journey with a simple but engaging project!

Welcome to a code project that's been crafted with passion and precision by Wassim HEDFI in February 2022. Unveil the magic of robotics as we dive into the world of Line follower robots, where every line is followed meticulously.

Copyright-Free Coding Wonderland

This Arduino code is a gift to the world, devoid of copyright shackles. Feel free to wield it, mold it, and share it with fellow enthusiasts. Let's spread the knowledge far and wide, shall we?

The Robot That's All About Following Lines

Behold, our star of the show—a 2wd Robot armed with a formidable array of 7 IR sensors and the mystical power of PID Regulation. It's ready to dance along the lines, thanks to this ingenious code.

Fine-Tuning: Your Path to Perfection

Now, let's put you in the driver's seat. To make this code perform its magic on your robot, you'll need to do a bit of fine-tuning. Head over to the "Constants for PID and Motors" section, and let the tweaking begin!

Start by setting 'motor1speed' and 'motor2speed' to your liking, and don't forget the 'OutputFactor.' Now, here's where the real fun begins. Begin with 'ki' and 'kd' at null, and sprinkle a small value (e.g., 0.01) onto 'kp'.Start increasing it and Watch in awe as your robot starts its line-following journey.

As you get mesmerized by the smooth dance of PID, it's time to bring 'ki' into the mix. Start small (e.g., 0.0001) and gradually increase it until you see that perfect PID ballet unfold. 'kd' is an optional guest at this party; it may not be everyone's cup of tea, so tread carefully. If you decide to invite it, let it join with a humble 0.001.

Note to Self: Constants Are as Wily as the Wind

Keep in mind, these constants can be as elusive as a breeze, and they love to change depending on countless factors. Don't take my word for it; experiment and see for yourself. If you find yourself lost in the PID wilderness, consider consulting the sacred texts of PID Regulation documentation.

Options Galore

But wait, there's more! This code isn't just for the PID elite; it's also set up to cater to those who prefer the trusty 'if statements' route. Versatility is our middle name!

Let the Adventure Begin!

So, fellow explorer, embrace this code, venture into the world of robotics, and never cease the adventure. Remember, it's not just lines you'll be following; it's your curiosity that will guide you. Happy coding, and may your robot's journey be as thrilling as me.

About

Arduino code for a 2WD line-following robot using PID control. Customize motor speeds and PID constants to achieve precise line tracking. Enjoy flexibility with optional 'if statements' control.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages