SimpleFOClibrary  2.1
pid.h
Go to the documentation of this file.
1 #ifndef PID_H
2 #define PID_H
3 
4 
5 #include "time_utils.h"
6 #include "foc_utils.h"
7 
12 {
13 public:
22  PIDController(float P, float I, float D, float ramp, float limit);
23  ~PIDController() = default;
24 
25  float operator() (float error);
26 
27  float P;
28  float I;
29  float D;
30  float output_ramp;
31  float limit;
32 
33 protected:
34  float integral_prev;
35  float error_prev;
36  unsigned long timestamp_prev;
37  float output_prev;
38 };
39 
40 #endif // PID_H
PIDController::error_prev
float error_prev
last tracking error value
Definition: pid.h:35
PIDController::I
float I
Integral gain.
Definition: pid.h:28
PIDController::operator()
float operator()(float error)
Definition: pid.cpp:17
foc_utils.h
PIDController::~PIDController
~PIDController()=default
PIDController::timestamp_prev
unsigned long timestamp_prev
Last execution timestamp.
Definition: pid.h:36
PIDController::output_prev
float output_prev
last pid output value
Definition: pid.h:37
PIDController::limit
float limit
Maximum output value.
Definition: pid.h:31
PIDController::PIDController
PIDController(float P, float I, float D, float ramp, float limit)
Definition: pid.cpp:3
PIDController::output_ramp
float output_ramp
Maximum speed of change of the output value.
Definition: pid.h:30
time_utils.h
PIDController::P
float P
Proportional gain.
Definition: pid.h:27
PIDController::D
float D
Derivative gain.
Definition: pid.h:29
PIDController
Definition: pid.h:12
PIDController::integral_prev
float integral_prev
last integral component value
Definition: pid.h:34