rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes
ClosedLoopFuelCellBase Class Referenceabstract

#include <closed_loop_fuel_cell.h>

Inheritance diagram for ClosedLoopFuelCellBase:
Inheritance graph
[legend]
Collaboration diagram for ClosedLoopFuelCellBase:
Collaboration graph
[legend]

Public Member Functions

void update (float lambdaDeadband, bool ignoreErrorMagnitude)
 
float getAdjustment () const
 
virtual float getLambdaError () const =0
 

Protected Member Functions

virtual float getMaxAdjustment () const =0
 
virtual float getMinAdjustment () const =0
 
virtual float getIntegratorGain () const =0
 

Private Attributes

float m_adjustment = 0
 

Detailed Description

Definition at line 5 of file closed_loop_fuel_cell.h.

Member Function Documentation

◆ getAdjustment()

float ClosedLoopFuelCellBase::getAdjustment ( ) const

Definition at line 36 of file closed_loop_fuel_cell.cpp.

36 {
37 return 1.0f + m_adjustment;
38}

◆ getIntegratorGain()

virtual float ClosedLoopFuelCellBase::getIntegratorGain ( ) const
protectedpure virtual

Implemented in ClosedLoopFuelCellImpl.

Referenced by update().

Here is the caller graph for this function:

◆ getLambdaError()

virtual float ClosedLoopFuelCellBase::getLambdaError ( ) const
pure virtual

Implemented in ClosedLoopFuelCellImpl.

Referenced by update().

Here is the caller graph for this function:

◆ getMaxAdjustment()

virtual float ClosedLoopFuelCellBase::getMaxAdjustment ( ) const
protectedpure virtual

Implemented in ClosedLoopFuelCellImpl.

Referenced by update().

Here is the caller graph for this function:

◆ getMinAdjustment()

virtual float ClosedLoopFuelCellBase::getMinAdjustment ( ) const
protectedpure virtual

Implemented in ClosedLoopFuelCellImpl.

Referenced by update().

Here is the caller graph for this function:

◆ update()

void ClosedLoopFuelCellBase::update ( float  lambdaDeadband,
bool  ignoreErrorMagnitude 
)

Definition at line 9 of file closed_loop_fuel_cell.cpp.

10{
11 // Compute how far off target we are
12 float lambdaError = getLambdaError();
13
14 // If we're within the deadband, make no adjustment.
15 if (std::abs(lambdaError) < lambdaDeadband) {
16 return;
17 }
18
19 // Fixed magnitude - runs in constant adjustment rate mode
20 if (ignoreErrorMagnitude) {
21 if (lambdaError > 0) {
22 lambdaError = 0.1f;
23 } else {
24 lambdaError = -0.1f;
25 }
26 }
27
28 // Integrate
29 float adjust = getIntegratorGain() * lambdaError * integrator_dt
31
32 // Clamp to bounds and save
33 m_adjustment = clampF(getMinAdjustment(), adjust, getMaxAdjustment());
34}
virtual float getMaxAdjustment() const =0
virtual float getLambdaError() const =0
virtual float getIntegratorGain() const =0
virtual float getMinAdjustment() const =0
constexpr float integrator_dt
Here is the call graph for this function:

Field Documentation

◆ m_adjustment

float ClosedLoopFuelCellBase::m_adjustment = 0
private

Definition at line 24 of file closed_loop_fuel_cell.h.

Referenced by getAdjustment(), and update().


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