Struct Pid::Gains

Nested Relationships

This struct is a nested type of Class Pid.

Struct Documentation

struct Gains

Store gains in a struct to allow easier realtime buffer usage.

Public Functions

inline Gains(double p, double i, double d, double i_max, double i_min)

Optional constructor for passing in values without antiwindup.

Parameters:
  • p – The proportional gain.

  • i – The integral gain.

  • d – The derivative gain.

  • i_max – The max integral windup.

  • i_min – The min integral windup.

Throws:

An – std::invalid_argument exception is thrown if i_min > i_max

inline Gains(double p, double i, double d, double i_max, double i_min, bool antiwindup)

Optional constructor for passing in values.

Parameters:
  • p – The proportional gain.

  • i – The integral gain.

  • d – The derivative gain.

  • i_max – The max integral windup.

  • i_min – The min integral windup.

  • antiwindup – If true, antiwindup is enabled and i_max/i_min are enforced

Throws:

An – std::invalid_argument exception is thrown if i_min > i_max

inline Gains()

Public Members

double p_gain_

Proportional gain.

double i_gain_

Integral gain.

double d_gain_

Derivative gain.

double i_max_

Maximum allowable integral term.

double i_min_

Minimum allowable integral term.

bool antiwindup_

Antiwindup.