PID Control 1.0
Discrete time implementation of P, PI, PD, PID. Including derivative filter, integral clamping, feed-forward, gain scheduling in standard and parallel form.
Loading...
Searching...
No Matches
PID Control Library

Introduction

This library provides a collection of reusable C++ components for implementing Proportional-Integral-Derivative (PID) based control systems.

The library is designed to provide modular implementations of individual control actions as well as commonly used combinations such as P, PI, PD, and PID controllers.

Features

The library provides implementations for:

  • Proportional (P) control
  • Integral (I) control
  • Derivative (D) control
  • Proportional-Integral (PI) control
  • Proportional-Derivative (PD) control
  • Proportional-Integral-Derivative (PID) control
  • PID controllers with different structural forms
  • Derivative low-pass filtering
  • PID low-pass filtering
  • Feed-forward PID control
  • Utility functions for control-system implementations

Library Organization

The library is organized into separate modules according to the type of controller:

include/
+-- d.h
+-- d_lpf_1.h
+-- i.h
+-- pd/
+-- pd.h
+-- pd_lpf_1.h
+-- pi/
+-- pi.h
+-- pid/
+-- pid.h
+-- pid_gs.h
+-- pid_lpf_1.h
+-- pid_lpf_1_ff.h
+-- pid_p.h
+-- pid_s.h
+-- p.h
+-- utility/
+-- utility.h
Contains control-system algorithms and controllers.
Definition d.h:32
Contains derivative controller implementations.
Contains integral controller implementations.
Contains proportional-derivative controller implementations.
Contains proportional-integral controller implementations.
Contains proportional-integral-derivative controller implementations.
Contains proportional control implementations.

The implementation of the templates is located in the corresponding .tpp files under the src directory.

Controllers

Proportional Controller

The proportional controller generates a control action proportional to the current error.

Integral Controller

The integral controller accumulates the error over time and is commonly used to eliminate steady-state error.

Derivative Controller

The derivative controller generates a control action based on the rate of change of the error.

PI Controller

Combines proportional and integral actions to provide improved tracking while eliminating steady-state error.

PD Controller

Combines proportional and derivative actions to improve transient response and damping.

PID Controller

Combines proportional, integral, and derivative actions:

\‍[u(t) = K_p e(t) + K_i \int e(t)\,dt + K_d \frac{de(t)}{dt}
\‍]

where:

  • $e(t)$ is the control error.
  • $K_p$ is the proportional gain.
  • $K_i$ is the integral gain.
  • $K_d$ is the derivative gain.
  • $u(t)$ is the controller output.

Filtering

The library provides low-pass filtered derivative and PID implementations to reduce the influence of high-frequency measurement noise on the derivative action.

Feed-Forward Control

The library also provides a PID implementation with feed-forward support. Feed-forward control can be used when a known component of the required control action can be estimated from the desired trajectory or system dynamics.

Documentation

This documentation is generated using Doxygen.

The public API is provided through the header files under the include directory, while template implementations are contained in the corresponding .tpp files under the src directory.

License

Author
Version