I'm using PIC18F4520 to make a line tracking robot. It has to use an array of 10 LED/Photo-transistor pairs. Now i have to implement PI control on the robot. I've already done normal line tracking with a couple of LED/Photo-transistor pairs without PID. I have studied documentations on PI and understand how it works. What I want to ask is what will the PI control do? The error will be the comparator output going to zero when it moves offline? And will the PI rectify the error in software?
The PI controller is simply the same controler without the derivative gain (which helps you with the quick changes). The I gain (integral) will remove the steady state error from the output, for example the the robot is moving 5mm to the right of the line, this 5mm will be corrected by the I gain.
check these links, for the understanding and coding: **broken link removed** **broken link removed**