SimpleFOClibrary  2.1
PIDController Class Reference

#include <pid.h>

Public Member Functions

 PIDController (float P, float I, float D, float ramp, float limit)
 
 ~PIDController ()=default
 
float operator() (float error)
 

Public Attributes

float P
 Proportional gain. More...
 
float I
 Integral gain. More...
 
float D
 Derivative gain. More...
 
float output_ramp
 Maximum speed of change of the output value. More...
 
float limit
 Maximum output value. More...
 

Protected Attributes

float integral_prev
 last integral component value More...
 
float error_prev
 last tracking error value More...
 
unsigned long timestamp_prev
 Last execution timestamp. More...
 
float output_prev
 last pid output value More...
 

Detailed Description

PID controller class

Definition at line 11 of file pid.h.

Constructor & Destructor Documentation

◆ PIDController()

PIDController::PIDController ( float  P,
float  I,
float  D,
float  ramp,
float  limit 
)
Parameters
P- Proportional gain
I- Integral gain
D- Derivative gain
ramp- Maximum speed of change of the output value
limit- Maximum output value

Definition at line 3 of file pid.cpp.

◆ ~PIDController()

PIDController::~PIDController ( )
default

Member Function Documentation

◆ operator()()

float PIDController::operator() ( float  error)

Definition at line 17 of file pid.cpp.

Member Data Documentation

◆ D

float PIDController::D

Derivative gain.

Definition at line 29 of file pid.h.

◆ error_prev

float PIDController::error_prev
protected

last tracking error value

Definition at line 35 of file pid.h.

◆ I

float PIDController::I

Integral gain.

Definition at line 28 of file pid.h.

◆ integral_prev

float PIDController::integral_prev
protected

last integral component value

Definition at line 34 of file pid.h.

◆ limit

float PIDController::limit

Maximum output value.

Definition at line 31 of file pid.h.

◆ output_prev

float PIDController::output_prev
protected

last pid output value

Definition at line 37 of file pid.h.

◆ output_ramp

float PIDController::output_ramp

Maximum speed of change of the output value.

Definition at line 30 of file pid.h.

◆ P

float PIDController::P

Proportional gain.

Definition at line 27 of file pid.h.

◆ timestamp_prev

unsigned long PIDController::timestamp_prev
protected

Last execution timestamp.

Definition at line 36 of file pid.h.


The documentation for this class was generated from the following files: