#ifndef COMPLIB_SERVER_PID_HPP
#define COMPLIB_SERVER_PID_HPP

#include <chrono>

class PID {
public:
  PID();

  PID(double P, double I, double D, double ramp, double limit);

  ~PID() = default;

  double operator()(double setpoint, double process_variable);

  double P = 1;
  double I = 0;
  double D = 0;
  double setpoint_ramp = 0;
  double limit = 0;

private:
  typedef std::chrono::steady_clock clock;
#

  double error_prev = 0;
  double setpoint_prev = 0;
  double integral_prev = 0;
  clock::time_point timestamp_prev = clock::now();
};

#endif // COMPLIB_SERVER_PID_HPP