ESPHome  2024.12.2
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_autotuner_id (std::string id)
 
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_
 
std::string id_
 

Detailed Description

Definition at line 13 of file pid_autotuner.h.

Member Enumeration Documentation

◆ State

Enumerator
AUTOTUNE_RUNNING 
AUTOTUNE_SUCCEEDED 

Definition at line 105 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 196 of file pid_autotuner.cpp.

◆ config()

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

Definition at line 25 of file pid_autotuner.h.

◆ dump_config()

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

Definition at line 139 of file pid_autotuner.cpp.

◆ get_ziegler_nichols_pid_()

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

Definition at line 101 of file pid_autotuner.h.

◆ is_finished()

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

Definition at line 30 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 206 of file pid_autotuner.cpp.

◆ set_autotuner_id()

void esphome::pid::PIDAutotuner::set_autotuner_id ( std::string  id)
inline

Definition at line 34 of file pid_autotuner.h.

◆ set_noiseband()

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

Definition at line 36 of file pid_autotuner.h.

◆ set_output_negative()

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

Definition at line 42 of file pid_autotuner.h.

◆ set_output_positive()

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

Definition at line 41 of file pid_autotuner.h.

◆ update()

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

Definition at line 73 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 103 of file pid_autotuner.h.

◆ frequency_detector_

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

◆ id_

std::string esphome::pid::PIDAutotuner::id_
protected

Definition at line 111 of file pid_autotuner.h.

◆ ku_

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

Definition at line 109 of file pid_autotuner.h.

◆ pu_

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

Definition at line 110 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 104 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: