APM:Libraries
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
AC_PI_2D Class Reference

Copter PID control class. More...

#include <AC_PI_2D.h>

Collaboration diagram for AC_PI_2D:
[legend]

Classes

struct  ac_pid_flags
 

Public Member Functions

 AC_PI_2D (float initial_p, float initial_i, float initial_imax, float initial_filt_hz, float dt)
 
void set_dt (float dt)
 
void set_input (const Vector2f &input)
 
void set_input (const Vector3f &input)
 
Vector2f get_pi ()
 
Vector2f get_p () const
 
Vector2f get_i ()
 
Vector2f get_i_shrink ()
 
void reset_I ()
 
void reset_filter ()
 
void load_gains ()
 
void save_gains ()
 
void operator() (float p, float i, float imaxval, float input_filt_hz, float dt)
 operator function call for easy initialisation More...
 
AP_Float & kP ()
 
AP_Float & kI ()
 
float imax () const
 
float filt_hz () const
 
float get_filt_alpha () const
 
void kP (const float v)
 
void kI (const float v)
 
void imax (const float v)
 
void filt_hz (const float v)
 
Vector2f get_integrator () const
 
void set_integrator (const Vector2f &i)
 
void set_integrator (const Vector3f &i)
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Protected Member Functions

void calc_filt_alpha ()
 

Protected Attributes

AP_Float _kp
 
AP_Float _ki
 
AP_Float _imax
 
AP_Float _filt_hz
 
struct AC_PI_2D::ac_pid_flags _flags
 
float _dt
 
Vector2f _integrator
 
Vector2f _input
 
float _filt_alpha
 

Detailed Description

Copter PID control class.

Definition at line 16 of file AC_PI_2D.h.

Constructor & Destructor Documentation

◆ AC_PI_2D()

AC_PI_2D::AC_PI_2D ( float  initial_p,
float  initial_i,
float  initial_imax,
float  initial_filt_hz,
float  dt 
)

Definition at line 33 of file AC_PI_2D.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ calc_filt_alpha()

void AC_PI_2D::calc_filt_alpha ( )
protected

Definition at line 166 of file AC_PI_2D.cpp.

Referenced by filt_hz(), load_gains(), operator()(), and set_dt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ filt_hz() [1/2]

float AC_PI_2D::filt_hz ( ) const
inline

Definition at line 56 of file AC_PI_2D.h.

Referenced by AC_PI_2D(), and imax().

Here is the caller graph for this function:

◆ filt_hz() [2/2]

void AC_PI_2D::filt_hz ( const float  v)

Definition at line 57 of file AC_PI_2D.cpp.

Here is the call graph for this function:

◆ get_filt_alpha()

float AC_PI_2D::get_filt_alpha ( ) const
inline

Definition at line 57 of file AC_PI_2D.h.

◆ get_i()

Vector2f AC_PI_2D::get_i ( )

Definition at line 94 of file AC_PI_2D.cpp.

Referenced by get_pi(), and set_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_i_shrink()

Vector2f AC_PI_2D::get_i_shrink ( )

Definition at line 108 of file AC_PI_2D.cpp.

Referenced by set_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_integrator()

Vector2f AC_PI_2D::get_integrator ( ) const
inline

Definition at line 65 of file AC_PI_2D.h.

◆ get_p()

Vector2f AC_PI_2D::get_p ( ) const

Definition at line 89 of file AC_PI_2D.cpp.

Referenced by get_pi(), and set_input().

Here is the caller graph for this function:

◆ get_pi()

Vector2f AC_PI_2D::get_pi ( )

Definition at line 122 of file AC_PI_2D.cpp.

Referenced by set_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ imax() [1/2]

float AC_PI_2D::imax ( ) const
inline

Definition at line 55 of file AC_PI_2D.h.

◆ imax() [2/2]

void AC_PI_2D::imax ( const float  v)
inline

Definition at line 62 of file AC_PI_2D.h.

Here is the call graph for this function:

◆ kI() [1/2]

AP_Float& AC_PI_2D::kI ( )
inline

Definition at line 54 of file AC_PI_2D.h.

◆ kI() [2/2]

void AC_PI_2D::kI ( const float  v)
inline

Definition at line 61 of file AC_PI_2D.h.

◆ kP() [1/2]

AP_Float& AC_PI_2D::kP ( )
inline

Definition at line 53 of file AC_PI_2D.h.

◆ kP() [2/2]

void AC_PI_2D::kP ( const float  v)
inline

Definition at line 60 of file AC_PI_2D.h.

◆ load_gains()

void AC_PI_2D::load_gains ( )

Definition at line 132 of file AC_PI_2D.cpp.

Referenced by set_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator()()

void AC_PI_2D::operator() ( float  p,
float  i,
float  imaxval,
float  input_filt_hz,
float  dt 
)

operator function call for easy initialisation

Overload the function call operator to permit easy initialisation.

Definition at line 154 of file AC_PI_2D.cpp.

Referenced by set_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_filter()

void AC_PI_2D::reset_filter ( )

Referenced by set_input().

Here is the caller graph for this function:

◆ reset_I()

void AC_PI_2D::reset_I ( )

Definition at line 127 of file AC_PI_2D.cpp.

Referenced by set_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_gains()

void AC_PI_2D::save_gains ( )

Definition at line 145 of file AC_PI_2D.cpp.

Referenced by set_input().

Here is the caller graph for this function:

◆ set_dt()

void AC_PI_2D::set_dt ( float  dt)

Definition at line 49 of file AC_PI_2D.cpp.

Here is the call graph for this function:

◆ set_input() [1/2]

void AC_PI_2D::set_input ( const Vector2f input)

Definition at line 71 of file AC_PI_2D.cpp.

◆ set_input() [2/2]

void AC_PI_2D::set_input ( const Vector3f input)
inline

Definition at line 29 of file AC_PI_2D.h.

Referenced by set_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_integrator() [1/2]

void AC_PI_2D::set_integrator ( const Vector2f i)
inline

Definition at line 66 of file AC_PI_2D.h.

◆ set_integrator() [2/2]

void AC_PI_2D::set_integrator ( const Vector3f i)
inline

Definition at line 67 of file AC_PI_2D.h.

Member Data Documentation

◆ _dt

float AC_PI_2D::_dt
protected

Definition at line 89 of file AC_PI_2D.h.

Referenced by calc_filt_alpha(), get_i(), get_i_shrink(), operator()(), and set_dt().

◆ _filt_alpha

float AC_PI_2D::_filt_alpha
protected

Definition at line 92 of file AC_PI_2D.h.

Referenced by calc_filt_alpha(), get_filt_alpha(), and set_input().

◆ _filt_hz

AP_Float AC_PI_2D::_filt_hz
protected

Definition at line 81 of file AC_PI_2D.h.

Referenced by calc_filt_alpha(), filt_hz(), load_gains(), operator()(), and save_gains().

◆ _flags

struct AC_PI_2D::ac_pid_flags AC_PI_2D::_flags
protected

Referenced by AC_PI_2D(), and set_input().

◆ _imax

AP_Float AC_PI_2D::_imax
protected

Definition at line 80 of file AC_PI_2D.h.

Referenced by AC_PI_2D(), get_i(), get_i_shrink(), imax(), load_gains(), operator()(), and save_gains().

◆ _input

Vector2f AC_PI_2D::_input
protected

Definition at line 91 of file AC_PI_2D.h.

Referenced by get_i(), get_i_shrink(), get_p(), and set_input().

◆ _integrator

Vector2f AC_PI_2D::_integrator
protected

Definition at line 90 of file AC_PI_2D.h.

Referenced by get_i(), get_i_shrink(), get_integrator(), reset_I(), and set_integrator().

◆ _ki

AP_Float AC_PI_2D::_ki
protected

Definition at line 79 of file AC_PI_2D.h.

Referenced by AC_PI_2D(), get_i(), get_i_shrink(), kI(), load_gains(), operator()(), and save_gains().

◆ _kp

AP_Float AC_PI_2D::_kp
protected

Definition at line 78 of file AC_PI_2D.h.

Referenced by AC_PI_2D(), get_p(), kP(), load_gains(), operator()(), and save_gains().

◆ var_info

const AP_Param::GroupInfo AC_PI_2D::var_info
static
Initial value:

Definition at line 70 of file AC_PI_2D.h.

Referenced by AC_PI_2D().


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