I need to implement a PID control. I've seen a lot of tutorials online, and I get the concept, but am just having thinking on how to implement it. For example I know the desired value vs. the actual value (is this from dead reckoning?) is needed. How is the desired value calculated? For example, the software tells the robot to move x inches forward. At the end of the process you would have the desired value and the actual value (encoder readings). However, what if your code is not to "move forward x inches", but rather just "move forward". How would the desired position be calculated then?
Also, what exactly is done with the output of the PID loop?
I appreciate the help.