I’m working on a line maze solver and implemented PID control.5 tcrt5000 sensor array is used to detect the line.My question is,as PID always tries so keep the middle sensor on the line,that is favors the 00100 condition, when the bot approaches a right angle turn, like condition like 00111, PID throws in correction by increasing right motor speed so the bot turns to the left.But the bot should go right and PID does exactly the opposite.
On side note, how do I precisely take 90 degree turns needed for the maze solving part of the code.
P.S. I added my code, I know some things are wrong but you’ll get a rough idea on how I planned solving the maze and implementing PID control.
maze.ino (5.5 KB)