rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
LuaIndustrialPid Struct Referencefinal

#include <lua_pid.h>

Collaboration diagram for LuaIndustrialPid:
Collaboration graph
[legend]

Public Member Functions

 LuaIndustrialPid ()=default
 
 LuaIndustrialPid (float kp, float ki, float kd, float min, float max)
 
float get (float target, float input)
 
void setOffset (float offset)
 
void setDerivativeFilterLoss (float derivativeFilterLoss)
 
void setAntiwindupFreq (float antiwindupFreq)
 
void reset ()
 

Private Attributes

PidIndustrial m_pid
 
Timer m_lastUpdate
 
pid_s m_params
 

Detailed Description

Definition at line 54 of file lua_pid.h.

Constructor & Destructor Documentation

◆ LuaIndustrialPid() [1/2]

LuaIndustrialPid::LuaIndustrialPid ( )
default

◆ LuaIndustrialPid() [2/2]

LuaIndustrialPid::LuaIndustrialPid ( float  kp,
float  ki,
float  kd,
float  min,
float  max 
)
inline

Member Function Documentation

◆ get()

float LuaIndustrialPid::get ( float  target,
float  input 
)
inline

Definition at line 76 of file lua_pid.h.

76 {
77#if EFI_UNIT_TEST
78 // this is how we avoid zero dt
79 advanceTimeUs(1000);
80#endif
81
82 float dt = m_lastUpdate.getElapsedSecondsAndReset(getTimeNowNt());
83
84 return m_pid.getOutput(target, input, dt);
85 }
float getOutput(float target, float input, float dTime) override
Definition efi_pid.cpp:249
efitick_t getTimeNowNt()
Definition efitime.cpp:19
void advanceTimeUs(int us)

Referenced by configureRusefiLuaHooks().

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

◆ reset()

void LuaIndustrialPid::reset ( )
inline

Definition at line 102 of file lua_pid.h.

102 {
103 m_pid.reset();
104 }
virtual void reset()
Definition efi_pid.cpp:103

Referenced by configureRusefiLuaHooks(), setAntiwindupFreq(), setDerivativeFilterLoss(), and setOffset().

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

◆ setAntiwindupFreq()

void LuaIndustrialPid::setAntiwindupFreq ( float  antiwindupFreq)
inline

Definition at line 97 of file lua_pid.h.

97 {
98 m_pid.antiwindupFreq = antiwindupFreq;
99 reset();
100 }
float antiwindupFreq
Definition efi_pid.h:123

Referenced by configureRusefiLuaHooks().

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

◆ setDerivativeFilterLoss()

void LuaIndustrialPid::setDerivativeFilterLoss ( float  derivativeFilterLoss)
inline

Definition at line 92 of file lua_pid.h.

92 {
93 m_pid.derivativeFilterLoss = derivativeFilterLoss;
94 reset();
95 }
float derivativeFilterLoss
Definition efi_pid.h:124

Referenced by configureRusefiLuaHooks().

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

◆ setOffset()

void LuaIndustrialPid::setOffset ( float  offset)
inline

Definition at line 87 of file lua_pid.h.

87 {
89 reset();
90 }
uint16_t offset
Definition tunerstudio.h:0

Referenced by configureRusefiLuaHooks().

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

Field Documentation

◆ m_lastUpdate

Timer LuaIndustrialPid::m_lastUpdate
private

Definition at line 108 of file lua_pid.h.

Referenced by get(), and LuaIndustrialPid().

◆ m_params

pid_s LuaIndustrialPid::m_params
private

Definition at line 109 of file lua_pid.h.

Referenced by LuaIndustrialPid(), and setOffset().

◆ m_pid

PidIndustrial LuaIndustrialPid::m_pid
private

Definition at line 107 of file lua_pid.h.

Referenced by get(), reset(), setAntiwindupFreq(), and setDerivativeFilterLoss().


The documentation for this struct was generated from the following file: