I am kind of new to control systems and I am currently making a line follower using PID loop. I am using 6 IR LED Photo-transistor pairs to detect the line but I am not sure how to calculate the error. I searched online and many people use error = set point - position(current), but I am struggling to figure out how to use the input from the 6 sensors to get a precise position.
PS- I tried the loop with digital sensor input and it worked (giving each case an error value) but I am planning to analog values of sensors.
The line width is approximately 1.7 cm and it is a white line on a black track. Also this project is for a competition, and I would really appreciate any advice on which micro controller to use (currently using STM32F401RE or Arduino Uno) or any other thing I can do to make the robot faster and better. Cheers!