trick/trick_sims/SIM_lander/models/PIDController
jmpenn 76e4095587
Update README.md
Fix links
2020-06-04 20:27:08 -05:00
..
images Update SIM_lander with new PIDController class #1006 2020-06-04 20:21:24 -05:00
include Update SIM_lander with new PIDController class #1006 2020-06-04 20:21:24 -05:00
src Update SIM_lander with new PIDController class #1006 2020-06-04 20:21:24 -05:00
README.md Update README.md 2020-06-04 20:27:08 -05:00

class PIDController

PID Controller Diagram

Constructor

PIDController::PIDController(
    double kp,   // proportional gain
    double ki,   // integral gain
    double kd,   // derivative gain
    double omax, // limiter maximum
    double omin, // limiter minimum
    double dt,   // sample period
    double tc    // filter time constant
    );

For no filtering, set tc to the value of dt. To filter, set tc a value higher than dt.

double PIDController::getOutput( double setpoint_value,
                                 double measured_value);

This function generates the control command (corresponding to cmd in the above diagram.) for the plant. The "plant" is the thing that you are controlling.

For example, the plant could be a lunar lander. The measured value could be altitude, and the command could be motor thrust. The setpoint is the what you want the output of the plant to be. The setpoint could be an altitude of 100 feet. The measured_value is the actual output (the actual altitude) of the lander plus perhaps some noise (because sensors aren't perfect).

References

The following videos provide some excellent instruction about PID control:

Understanding PID Control, Part 1: What is PID Control?

Understanding PID Control, Part 2: Expanding Beyond a Simple Integral

Understanding PID Control, Part 3: Part 3: Expanding Beyond a Simple Derivative

Understanding PID Control, Part 4: A PID Tuning Guide