Rework library without unix sockets for now
This commit is contained in:
parent
e9ae1a320a
commit
0bef6035ae
30 changed files with 987 additions and 136 deletions
32
server_v2/include/PID.hpp
Normal file
32
server_v2/include/PID.hpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#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
|
Reference in a new issue