pid.h 642 B

123456789101112131415161718192021222324252627
  1. #ifndef PID_H
  2. #define PID_H
  3. class PIDImpl;
  4. class PID
  5. {
  6. public:
  7. // Kp - proportional gain
  8. // Ki - Integral gain
  9. // Kd - derivative gain
  10. // dt - loop interval time
  11. // max - maximum value of manipulated variable
  12. // min - minimum value of manipulated variable
  13. PID( double dt, double max, double min, double Kp, double Kd, double Ki );
  14. // Returns the manipulated variable given a setpoint and current process value
  15. double calculate( double setpoint, double pv );
  16. void clear();
  17. ~PID();
  18. private:
  19. PIDImpl *pimpl;
  20. };
  21. #endif // PID_H