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

Copter PID control class. More...

#include <AC_PID_2D.h>

Collaboration diagram for AC_PID_2D:
[legend]

Classes

struct  ac_pid_flags
 

Public Member Functions

 AC_PID_2D (float initial_p, float initial_i, float initial_d, float initial_imax, float initial_filt_hz, float initial_filt_d_hz, float dt)
 
void set_dt (float dt)
 
void set_input (const Vector2f &input)
 
void set_input (const Vector3f &input)
 
Vector2f get_pid ()
 
Vector2f get_p () const
 
Vector2f get_i ()
 
Vector2f get_i_shrink ()
 
Vector2f get_d ()
 
void reset_I ()
 
void reset_filter ()
 
void load_gains ()
 
void save_gains ()
 
AP_Float & kP ()
 
AP_Float & kI ()
 
float imax () const
 
float filt_hz () const
 
float get_filt_alpha () const
 
float filt_d_hz () const
 
float get_filt_alpha_D () const
 
void kP (const float v)
 
void kI (const float v)
 
void kD (const float v)
 
void imax (const float v)
 
void filt_hz (const float v)
 
void filt_d_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 set_input_filter_d (const Vector2f &input_delta)
 
void calc_filt_alpha ()
 
void calc_filt_alpha_d ()
 

Protected Attributes

AP_Float _kp
 
AP_Float _ki
 
AP_Float _kd
 
AP_Float _imax
 
AP_Float _filt_hz
 
AP_Float _filt_d_hz
 
struct AC_PID_2D::ac_pid_flags _flags
 
float _dt
 
float _filt_alpha
 
float _filt_alpha_d
 
Vector2f _integrator
 
Vector2f _input
 
Vector2f _derivative
 

Detailed Description

Copter PID control class.

Definition at line 13 of file AC_PID_2D.h.

Constructor & Destructor Documentation

◆ AC_PID_2D()

AC_PID_2D::AC_PID_2D ( float  initial_p,
float  initial_i,
float  initial_d,
float  initial_imax,
float  initial_filt_hz,
float  initial_filt_d_hz,
float  dt 
)

Definition at line 49 of file AC_PID_2D.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ calc_filt_alpha()

void AC_PID_2D::calc_filt_alpha ( )
protected

Definition at line 223 of file AC_PID_2D.cpp.

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

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

◆ calc_filt_alpha_d()

void AC_PID_2D::calc_filt_alpha_d ( )
protected

Definition at line 236 of file AC_PID_2D.cpp.

Referenced by filt_d_hz(), load_gains(), and set_dt().

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

◆ filt_d_hz() [1/2]

float AC_PID_2D::filt_d_hz ( ) const
inline

Definition at line 53 of file AC_PID_2D.h.

Referenced by AC_PID_2D(), and imax().

Here is the caller graph for this function:

◆ filt_d_hz() [2/2]

void AC_PID_2D::filt_d_hz ( const float  v)

Definition at line 88 of file AC_PID_2D.cpp.

Here is the call graph for this function:

◆ filt_hz() [1/2]

float AC_PID_2D::filt_hz ( ) const
inline

Definition at line 51 of file AC_PID_2D.h.

Referenced by AC_PID_2D(), and imax().

Here is the caller graph for this function:

◆ filt_hz() [2/2]

void AC_PID_2D::filt_hz ( const float  v)

Definition at line 76 of file AC_PID_2D.cpp.

Here is the call graph for this function:

◆ get_d()

Vector2f AC_PID_2D::get_d ( )

Definition at line 180 of file AC_PID_2D.cpp.

Referenced by get_pid(), AC_PosControl::run_xy_controller(), and set_input().

Here is the caller graph for this function:

◆ get_filt_alpha()

float AC_PID_2D::get_filt_alpha ( ) const
inline

Definition at line 52 of file AC_PID_2D.h.

◆ get_filt_alpha_D()

float AC_PID_2D::get_filt_alpha_D ( ) const
inline

Definition at line 54 of file AC_PID_2D.h.

◆ get_i()

Vector2f AC_PID_2D::get_i ( )

Definition at line 152 of file AC_PID_2D.cpp.

Referenced by get_pid(), AC_PosControl::run_xy_controller(), and set_input().

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

◆ get_i_shrink()

Vector2f AC_PID_2D::get_i_shrink ( )

Definition at line 166 of file AC_PID_2D.cpp.

Referenced by AC_PosControl::run_xy_controller(), and set_input().

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

◆ get_integrator()

Vector2f AC_PID_2D::get_integrator ( ) const
inline

Definition at line 64 of file AC_PID_2D.h.

◆ get_p()

Vector2f AC_PID_2D::get_p ( ) const

Definition at line 147 of file AC_PID_2D.cpp.

Referenced by get_pid(), AC_PosControl::run_xy_controller(), and set_input().

Here is the caller graph for this function:

◆ get_pid()

Vector2f AC_PID_2D::get_pid ( )

Definition at line 186 of file AC_PID_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_PID_2D::imax ( ) const
inline

Definition at line 50 of file AC_PID_2D.h.

◆ imax() [2/2]

void AC_PID_2D::imax ( const float  v)
inline

Definition at line 60 of file AC_PID_2D.h.

Here is the call graph for this function:

◆ kD()

void AC_PID_2D::kD ( const float  v)
inline

Definition at line 59 of file AC_PID_2D.h.

◆ kI() [1/2]

AP_Float& AC_PID_2D::kI ( )
inline

Definition at line 49 of file AC_PID_2D.h.

◆ kI() [2/2]

void AC_PID_2D::kI ( const float  v)
inline

Definition at line 58 of file AC_PID_2D.h.

◆ kP() [1/2]

AP_Float& AC_PID_2D::kP ( )
inline

Definition at line 48 of file AC_PID_2D.h.

Referenced by AC_Loiter::calc_desired_velocity().

Here is the caller graph for this function:

◆ kP() [2/2]

void AC_PID_2D::kP ( const float  v)
inline

Definition at line 57 of file AC_PID_2D.h.

◆ load_gains()

void AC_PID_2D::load_gains ( )

Definition at line 196 of file AC_PID_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_PID_2D::reset_filter ( )

Referenced by set_input().

Here is the caller graph for this function:

◆ reset_I()

void AC_PID_2D::reset_I ( )

Definition at line 191 of file AC_PID_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_PID_2D::save_gains ( )

Definition at line 212 of file AC_PID_2D.cpp.

Referenced by set_input().

Here is the caller graph for this function:

◆ set_dt()

void AC_PID_2D::set_dt ( float  dt)

Definition at line 67 of file AC_PID_2D.cpp.

Referenced by AC_PosControl::set_dt().

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

◆ set_input() [1/2]

void AC_PID_2D::set_input ( const Vector2f input)

Definition at line 102 of file AC_PID_2D.cpp.

Referenced by AC_PosControl::run_xy_controller().

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

◆ set_input() [2/2]

void AC_PID_2D::set_input ( const Vector3f input)
inline

Definition at line 26 of file AC_PID_2D.h.

Referenced by set_input().

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

◆ set_input_filter_d()

void AC_PID_2D::set_input_filter_d ( const Vector2f input_delta)
protected

Definition at line 125 of file AC_PID_2D.cpp.

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_PID_2D::set_integrator ( const Vector2f i)
inline

Definition at line 65 of file AC_PID_2D.h.

Referenced by AC_PosControl::init_vel_controller_xyz(), and AC_PosControl::init_xy_controller().

Here is the caller graph for this function:

◆ set_integrator() [2/2]

void AC_PID_2D::set_integrator ( const Vector3f i)
inline

Definition at line 66 of file AC_PID_2D.h.

Member Data Documentation

◆ _derivative

Vector2f AC_PID_2D::_derivative
protected

Definition at line 103 of file AC_PID_2D.h.

Referenced by get_d(), and set_input_filter_d().

◆ _dt

float AC_PID_2D::_dt
protected

◆ _filt_alpha

float AC_PID_2D::_filt_alpha
protected

Definition at line 99 of file AC_PID_2D.h.

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

◆ _filt_alpha_d

float AC_PID_2D::_filt_alpha_d
protected

Definition at line 100 of file AC_PID_2D.h.

Referenced by calc_filt_alpha_d(), get_filt_alpha_D(), and set_input_filter_d().

◆ _filt_d_hz

AP_Float AC_PID_2D::_filt_d_hz
protected

Definition at line 90 of file AC_PID_2D.h.

Referenced by calc_filt_alpha_d(), filt_d_hz(), load_gains(), and save_gains().

◆ _filt_hz

AP_Float AC_PID_2D::_filt_hz
protected

Definition at line 89 of file AC_PID_2D.h.

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

◆ _flags

struct AC_PID_2D::ac_pid_flags AC_PID_2D::_flags
protected

◆ _imax

AP_Float AC_PID_2D::_imax
protected

Definition at line 88 of file AC_PID_2D.h.

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

◆ _input

Vector2f AC_PID_2D::_input
protected

Definition at line 102 of file AC_PID_2D.h.

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

◆ _integrator

Vector2f AC_PID_2D::_integrator
protected

Definition at line 101 of file AC_PID_2D.h.

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

◆ _kd

AP_Float AC_PID_2D::_kd
protected

Definition at line 87 of file AC_PID_2D.h.

Referenced by AC_PID_2D(), get_d(), kD(), load_gains(), and save_gains().

◆ _ki

AP_Float AC_PID_2D::_ki
protected

Definition at line 86 of file AC_PID_2D.h.

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

◆ _kp

AP_Float AC_PID_2D::_kp
protected

Definition at line 85 of file AC_PID_2D.h.

Referenced by AC_PID_2D(), get_p(), kP(), load_gains(), and save_gains().

◆ var_info

const AP_Param::GroupInfo AC_PID_2D::var_info
static

Definition at line 69 of file AC_PID_2D.h.

Referenced by AC_PID_2D().


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