Things to know
- How to implement and tune a PID controller
- When is PID insufficient
- How to formulate a potential field for goal-based navigation
- Disadvantages of potential fields
- Vector Field Histogram
Intro
Goal
Figure out how to generate the Control Inputs (Actuating Signal) so we get the desired Controlled Variable (output/state).
There is always error between Commanded Variable (what we want the system to do) and the output (Controled Variable), otherwise, it's called Zero Error. We want to drive error to zero over time.
Solution: Controller
Controller's job is to reduce error.
PID
Suppose we have a current state and a goal state . The error is defined to be . can be either positive or negative.
P: Proportional (present)
Distance between and is the error and contributes to the controller system. The larger the distance, the larger the error.
I: Integral (Past)
This takes the past error into account. It integrates error over time, and the goal is to reach a integral error of zero.
For example, we are -5m from the , then +3m, then -1m, etc. As the integral of error goes to zero, we also gets closer to the .
i.e. We oscillate around the .
Integral of error from the beginning of the time:
D: Derivative (Future)
Sometimes we don't want to go over the . e.g. the target height of a drone is 50m, it might be too dangerous to reach 51m, or it's beyond the actuator's limit.
In this case, we add one more term: future/derivative. Derivative is the rate of change, and tells the future of a system. A positive derivative of speed means a drone will fly higher in the future. If we take this term into account, it avoids going (too much) over the 50m line.
Each term has a weighting factor that engineer needs to turn.
PID is the simplest controller that uses the past, present and future error to achieve a steady state (Zero Error).
How to Implement PID
-
Assume time is discrete
-
Identify error function, e.g.
-
Is the measurement reliable
-
If measurement is noisy, choices are smoothing/filtering using
-
Moving Average Filter with uniform weights
Take a window of past info into account by averaging the window
Potential Problem: the larger the window of the filter the slower it is going to register changes
-
Exponential Filter
,
Take past information into account.
Potential Problem: the closer is to 1(less current info considered), the slower it is going to register changes.
-
-
-
Approximate the integral of error by a sum
-
Approximate the derivative of error by:
-
Finte Differences
-