CSCI 235 - Intelligent Robotics
Spring 2017
Project #5: PID Control
Continuous-Valued Actions
In this project, we will examine a technique to employ continuous-valued
sensor inputs into continuous-valued motor outputs. A given continuous-valued
sensor input is given a target value. Any deviation from the target value is
considered to be an error. The goal of a control system is to select
robot actions that minimize this error value.
Proportional Control
Given a continuous sensor input and a target value for that input, the error
is the difference between the two. This error is multiplied by a constant
(P). The result of this calculation is used to set the robot's motor
speeds. It is important to select a value for P that results in
appropriate motor speeds.
Integral Control
If the error is biased in a particular direction, it can be helpful to apply
an additional correction to overcome the bias. We can calculate the bias by
maintaining a running total of all of the error values. If the errors are
unbiased, they should add up to zero. We multiply this total by a second constant (I) and add it to our value from the proportional step.
Derivative Control
If the system is oscillating excessively, it can be helpful to incorporate
the difference between consecutive errors into the calculation. We subtract
the previous error from the current error, multiply this difference
by a third constant (D), and add it to our value from the previous
two steps.
Library
The library files are in modeselection.zip. This includes all of the library files from the previous assignments.
Sample Program
The sample program is in proj5.zip.
Assignment
Implement three programs that use PID control:
- The first program should use the ultrasonic sensor to maintain a target
distance from an object. If the object moves away from the robot, it should
increase its speed until it catches up. If the object moves towards the robot,
it should back up. All motions should be proportional to the distance between
the robot and the object.
- Two additional programs can perform any task that you would like, as long
as using PID control is a natural aspect of the task.
Questions
- For each program, devise a metric for its performance on its task. How
well did each program perform? Feel free to experiment with different
parameter settings to optimize performance. Be sure to discuss the most useful
parameter settings in your report and presentation.
- For your second and third programs, what was the benefit of using PID
for completing the desired task?
- Did you use the I or D terms? Explain why or why not.
- What tradeoffs are involved in deciding between using a discrete action
and a continuous action? Use examples from this week's projects to support
your answers.