Path Following Robot PID

Hi,

I'm interested in building a path following robot (will probably use Arduino Uno) with just a single IR sensor (to detect path) and two wheels (using a DC motor per wheel) and the cheapest motor controller I can get. I've seen a bunch of Youtube videos where people have used the PID library to make it follow the path more accurately but I don't fully understand how its applied. Can you offer any guidance/examples or point me in the direction please?

Install the PID lib
https://playground.arduino.cc/Code/PIDLibrary

In PID you have

Input = IR sensor read
SetPoint = Target (what input should be)
Output = PWM to motor

So you need to setup 2 PID controllers, one for each motor and configure them according to your needs.

The above page give some info on pid controller functions.

Thank you :slight_smile: , I'll look in to it today.