Thank you for the response, jkerns!
Yes you are correct in that I want to drive up to a wall and stop at a certain distance. Let me clarify that I don't have an actual PID controller, but rather an embedded system (SunSPOT if you're wondering) that is taking the input from a rangefinder, performing ADC, and running a PID algorithm with the digital value (distance). As such, right now the output exists only as a number that is calculated by the algorithm. I still have to
do something based on this number that will change the PWM output that goes to the servo. I don't know what that something is yet.
I would just create a function of maximum speed vs. distance from your stopping point. It will go to zero at the stopping distance and the slope will be something easy to obtain as you coast. You could then just reduce your commanded motor power if you exceed the target line - you could use a P controller that is enabled the first time you cross the line.
I like this idea. I'm not sure if I am understanding correctly, so please allow me to summarize in my own words? It sounds like you're telling me I should draw up a graph of velocity as a function of distance to the wall. Then at each distance (or distance interval), have the set point in velocity based on this graph and read the error as difference in actual velocity vs set velocity. However, this means the set point for velocity is always changing. Is this an issue? And say I don't know what distance away from the wall I want to stop at yet, but rather it is something the professor inputs when the program is run. Now I can't quite draw up the function without that prior knowledge.
Sorry for all the questions. This is my first "lab" in my first ever controls class. I am finding it a very rich topic and am considering making it my concentration, despite all my current confusion.