EasyNav Simple Stack
Loading...
Searching...
No Matches
PIDController Class Reference

A simple PID (Proportional-Integral-Derivative) controller implementation. More...

#include <PIDController.hpp>

Public Member Functions

double get_output (double new_reference)
 Computes the control output for the given reference input.
 
 PIDController (double min_ref, double max_ref, double min_output, double max_output)
 Constructor.
 
void set_pid (double n_KP, double n_KI, double n_KD)
 Sets the PID gains.
 

Detailed Description

A simple PID (Proportional-Integral-Derivative) controller implementation.

Constructor & Destructor Documentation

◆ PIDController()

PIDController ( double min_ref,
double max_ref,
double min_output,
double max_output )

Constructor.

Initializes the PID controller with output and reference range limits.

Parameters
min_refMinimum allowed input reference value.
max_refMaximum allowed input reference value.
min_outputMinimum output control value.
max_outputMaximum output control value.

Member Function Documentation

◆ get_output()

double get_output ( double new_reference)

Computes the control output for the given reference input.

Applies the PID formula and returns the control command within the specified output limits.

Parameters
new_referenceThe current reference input value (e.g., error signal).
Returns
The computed control output.

◆ set_pid()

void set_pid ( double n_KP,
double n_KI,
double n_KD )

Sets the PID gains.

Parameters
n_KPProportional gain.
n_KIIntegral gain.
n_KDDerivative gain.

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