ESPHome  2021.11.3
Data Structures | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
esphome::pid::PIDAutotuner Class Reference

#include <pid_autotuner.h>

Data Structures

struct  OscillationAmplitudeDetector
 
struct  OscillationFrequencyDetector
 
struct  PIDAutotuneResult
 
struct  PIDResult
 
struct  RelayFunction
 

Public Member Functions

void config (float output_min, float output_max)
 
PIDAutotuneResult update (float setpoint, float process_variable)
 
bool is_finished () const
 
void dump_config ()
 
void set_noiseband (float noiseband)
 
void set_output_positive (float output_positive)
 
void set_output_negative (float output_negative)
 

Protected Types

enum  State { AUTOTUNE_RUNNING, AUTOTUNE_SUCCEEDED }
 

Protected Member Functions

PIDResult calculate_pid_ (float kp_factor, float ki_factor, float kd_factor)
 
void print_rule_ (const char *name, float kp_factor, float ki_factor, float kd_factor)
 
PIDResult get_ziegler_nichols_pid_ ()
 

Protected Attributes

struct esphome::pid::PIDAutotuner::RelayFunction relay_function_
 
struct esphome::pid::PIDAutotuner::OscillationFrequencyDetector frequency_detector_
 
struct esphome::pid::PIDAutotuner::OscillationAmplitudeDetector amplitude_detector_
 
uint32_t enough_data_phase_ = 0
 
float setpoint_ = NAN
 
enum esphome::pid::PIDAutotuner::State state_ = AUTOTUNE_RUNNING
 
float ku_
 
float pu_
 

Detailed Description

Definition at line 11 of file pid_autotuner.h.

Member Enumeration Documentation

◆ State

Enumerator
AUTOTUNE_RUNNING 
AUTOTUNE_SUCCEEDED 

Definition at line 101 of file pid_autotuner.h.

Member Function Documentation

◆ calculate_pid_()

PIDAutotuner::PIDResult esphome::pid::PIDAutotuner::calculate_pid_ ( float  kp_factor,
float  ki_factor,
float  kd_factor 
)
protected

Definition at line 188 of file pid_autotuner.cpp.

◆ config()

void esphome::pid::PIDAutotuner::config ( float  output_min,
float  output_max 
)
inline

Definition at line 23 of file pid_autotuner.h.

◆ dump_config()

void esphome::pid::PIDAutotuner::dump_config ( )

Definition at line 133 of file pid_autotuner.cpp.

◆ get_ziegler_nichols_pid_()

PIDResult esphome::pid::PIDAutotuner::get_ziegler_nichols_pid_ ( )
inlineprotected

Definition at line 97 of file pid_autotuner.h.

◆ is_finished()

bool esphome::pid::PIDAutotuner::is_finished ( ) const
inline

Definition at line 28 of file pid_autotuner.h.

◆ print_rule_()

void esphome::pid::PIDAutotuner::print_rule_ ( const char *  name,
float  kp_factor,
float  ki_factor,
float  kd_factor 
)
protected

Definition at line 198 of file pid_autotuner.cpp.

◆ set_noiseband()

void esphome::pid::PIDAutotuner::set_noiseband ( float  noiseband)
inline

Definition at line 32 of file pid_autotuner.h.

◆ set_output_negative()

void esphome::pid::PIDAutotuner::set_output_negative ( float  output_negative)
inline

Definition at line 38 of file pid_autotuner.h.

◆ set_output_positive()

void esphome::pid::PIDAutotuner::set_output_positive ( float  output_positive)
inline

Definition at line 37 of file pid_autotuner.h.

◆ update()

PIDAutotuner::PIDAutotuneResult esphome::pid::PIDAutotuner::update ( float  setpoint,
float  process_variable 
)

Definition at line 68 of file pid_autotuner.cpp.

Field Documentation

◆ amplitude_detector_

struct esphome::pid::PIDAutotuner::OscillationAmplitudeDetector esphome::pid::PIDAutotuner::amplitude_detector_
protected

◆ enough_data_phase_

uint32_t esphome::pid::PIDAutotuner::enough_data_phase_ = 0
protected

Definition at line 99 of file pid_autotuner.h.

◆ frequency_detector_

struct esphome::pid::PIDAutotuner::OscillationFrequencyDetector esphome::pid::PIDAutotuner::frequency_detector_
protected

◆ ku_

float esphome::pid::PIDAutotuner::ku_
protected

Definition at line 105 of file pid_autotuner.h.

◆ pu_

float esphome::pid::PIDAutotuner::pu_
protected

Definition at line 106 of file pid_autotuner.h.

◆ relay_function_

struct esphome::pid::PIDAutotuner::RelayFunction esphome::pid::PIDAutotuner::relay_function_
protected

◆ setpoint_

float esphome::pid::PIDAutotuner::setpoint_ = NAN
protected

Definition at line 100 of file pid_autotuner.h.

◆ state_

enum esphome::pid::PIDAutotuner::State esphome::pid::PIDAutotuner::state_ = AUTOTUNE_RUNNING
protected

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