pid.h 618 B

1234567891011121314151617181920212223242526
  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. ~PID();
  17. private:
  18. PIDImpl *pimpl;
  19. };
  20. #endif // PID_H