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
control_system::proportional::P< T > Class Template Reference

Proportional controller. More...

#include <p.h>

Public Member Functions

 P ()
 Constructs a proportional controller.
get_Kp ()
 Gets the proportional gain.
get_u_max ()
 Gets the maximum controller output.
void init (T Kp_, T u_max_)
 Initializes the proportional controller.
void reset ()
 Resets the controller.
void set_Kp (T Kp_)
 Sets the proportional gain.
void set_param (T Kp_, T u_max_)
 Sets the controller parameters.
void set_u_max (T u_max_)
 Sets the maximum controller output.
update (T x_0, T x)
 Computes the proportional control output.

Private Attributes

Kp = 0.0
 Proportional gain.
u_max = 9999999999
 Maximum controller output.

Detailed Description

template<typename T>
class control_system::proportional::P< T >

Proportional controller.

The P class implements a proportional controller in which the control output is proportional to the control error.

The controller uses a configurable proportional gain and maximum output limit.

Template Parameters
TNumeric data type used for the controller.
Example
controller.init(2.0, 100.0);
double output = controller.update(reference, measurement);
Proportional controller.
Definition p.h:71
void init(T Kp_, T u_max_)
Initializes the proportional controller.
Definition p.h:11
T update(T x_0, T x)
Computes the proportional control output.
Definition p.h:24

Definition at line 70 of file p.h.

Constructor & Destructor Documentation

◆ P()

template<typename T>
control_system::proportional::P< T >::P ( )

Constructs a proportional controller.

Constructs the controller with its parameters initialized to their default values.

Definition at line 5 of file p.h.

Member Function Documentation

◆ get_Kp()

template<typename T>
T control_system::proportional::P< T >::get_Kp ( )

Gets the proportional gain.

Returns
Proportional gain.

Definition at line 47 of file p.h.

◆ get_u_max()

template<typename T>
T control_system::proportional::P< T >::get_u_max ( )

Gets the maximum controller output.

Returns
Maximum allowed controller output.

Definition at line 53 of file p.h.

◆ init()

template<typename T>
void control_system::proportional::P< T >::init ( T Kp_,
T u_max_ )

Initializes the proportional controller.

Parameters
[in]Kp_Proportional gain.
[in]u_max_Maximum allowed controller output.

Initializes the proportional gain and output limit.

Definition at line 11 of file p.h.

◆ reset()

template<typename T>
void control_system::proportional::P< T >::reset ( )

Resets the controller.

Resets the controller state to its initial condition.

Definition at line 30 of file p.h.

◆ set_Kp()

template<typename T>
void control_system::proportional::P< T >::set_Kp ( T Kp_)

Sets the proportional gain.

Parameters
[in]Kp_Proportional gain.

Definition at line 35 of file p.h.

◆ set_param()

template<typename T>
void control_system::proportional::P< T >::set_param ( T Kp_,
T u_max_ )

Sets the controller parameters.

Parameters
[in]Kp_Proportional gain.
[in]u_max_Maximum allowed controller output.

Updates the proportional gain and maximum output limit.

Definition at line 17 of file p.h.

◆ set_u_max()

template<typename T>
void control_system::proportional::P< T >::set_u_max ( T u_max_)

Sets the maximum controller output.

Parameters
[in]u_max_Maximum allowed controller output.

Definition at line 41 of file p.h.

◆ update()

template<typename T>
T control_system::proportional::P< T >::update ( T x_0,
T x )

Computes the proportional control output.

Parameters
[in]x_0Reference or desired value.
[in]xCurrent or measured value.
Returns
Proportional control output limited to the configured maximum output.

Definition at line 24 of file p.h.

Member Data Documentation

◆ Kp

template<typename T>
T control_system::proportional::P< T >::Kp = 0.0
private

Proportional gain.

Definition at line 155 of file p.h.

◆ u_max

template<typename T>
T control_system::proportional::P< T >::u_max = 9999999999
private

Maximum controller output.

Defines the upper magnitude limit applied to the controller output.

Definition at line 164 of file p.h.


The documentation for this class was generated from the following files:
  • include/proportional/p.h
  • src/proportional/p.tpp