Quote:
Originally Posted by Ozuru
Hi GeeTwo,
What is the purpose of a PID subsystem? I have never understood why PIDSubsystems are used -- couldn't this have been accomplished using just a regular subsystem? What are the advantages to using a PIDSubsystem and when should it be used?
|
PID is a feedback technique. Feedback systems automatically adjust the inputs to a system (e.g. voltage applied to the motor) to seek a specified output (e.g. lift the tote so that it is 12" above the carpet). For Recycle Rush, we believe that this will help us perform line-up, pick-up, stack, and score actions more quickly than a human driver is likely to manage. While I don't think that the code as posted has it yet, we are going to limit the speed of lift/lower (specific number TBD, but probably about 2 fps) and provide "stop points" for various pickup, stacking, and scoring tasks.
PID allows you to set a target speed or position (or any other measurable quantity), and the code automatically seeks to attain and maintain that value. The key requirement of PID (or any other feedback technique) is that you are regularly measuring the output state of the system. This year on our lift, we're using a 10-turn potentiometer as a sensor. The current mechanical setup is the electrified tape measure similar to the one shown in
this post. One of our mentors doesn't trust return springs in cheap tape measures, so we may switch to something that engages a 22-tooth idle sprocket with our lift chain. Tuning the PID to minimize settle time, overshoot, oscillation, and droop is at least as much art as science, but we're going to take that plunge again this year.
We have also used PID loops in the past (and will again this year) to automatically aim our game piece manipulators. For Rebound Rumble, Ultimate Ascent and Aerial Assist, this meant driving the robot so that we were properly positioned to score when we threw the game piece. For Recycle Rush, our goal is to align on the totes (and RCs) so consistently that they form a neat, stable, stack. For these applications the sensor has been, or at least included, a camera. The desired "output" in this case is the size and location of a vision target as reported by some openCV scripts.