rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions
VvlController Class Reference

#include <vvl_controller.h>

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

Public Types

using interface_t = VvlController
 

Public Member Functions

void onSlowCallback () override
 
float getFuelCoefficient () const
 
float getTimingModifier () const
 
- Public Member Functions inherited from EngineModule
virtual void initNoConfiguration ()
 
virtual void setDefaultConfiguration ()
 
virtual void onConfigurationChange (engine_configuration_s const *)
 
virtual void onFastCallback ()
 
virtual void onEngineStop ()
 
virtual void onIgnitionStateChanged (bool)
 
virtual bool needsDelayedShutoff ()
 
virtual void onEnginePhase (float, efitick_t, angle_t, angle_t)
 

Private Member Functions

void updateTpsConditionSatisfied ()
 
void updateCltConditionSatisfied ()
 
void updateMapConditionSatisfied ()
 
void updateAfrConditionSatisfied ()
 
void updateRpmConditionSatisfied ()
 

Additional Inherited Members

- Data Fields inherited from vvl_controller_state_s
bool isVvlTpsCondition: 1 {}
 
bool isVvlCltCondition: 1 {}
 
bool isVvlMapCondition: 1 {}
 
bool isVvlAfrCondition: 1 {}
 
bool isVvlRpmCondition: 1 {}
 
bool isVvlCondition: 1 {}
 
bool unusedBit_6_6: 1 {}
 
bool unusedBit_6_7: 1 {}
 
bool unusedBit_6_8: 1 {}
 
bool unusedBit_6_9: 1 {}
 
bool unusedBit_6_10: 1 {}
 
bool unusedBit_6_11: 1 {}
 
bool unusedBit_6_12: 1 {}
 
bool unusedBit_6_13: 1 {}
 
bool unusedBit_6_14: 1 {}
 
bool unusedBit_6_15: 1 {}
 
bool unusedBit_6_16: 1 {}
 
bool unusedBit_6_17: 1 {}
 
bool unusedBit_6_18: 1 {}
 
bool unusedBit_6_19: 1 {}
 
bool unusedBit_6_20: 1 {}
 
bool unusedBit_6_21: 1 {}
 
bool unusedBit_6_22: 1 {}
 
bool unusedBit_6_23: 1 {}
 
bool unusedBit_6_24: 1 {}
 
bool unusedBit_6_25: 1 {}
 
bool unusedBit_6_26: 1 {}
 
bool unusedBit_6_27: 1 {}
 
bool unusedBit_6_28: 1 {}
 
bool unusedBit_6_29: 1 {}
 
bool unusedBit_6_30: 1 {}
 
bool unusedBit_6_31: 1 {}
 

Detailed Description

Definition at line 12 of file vvl_controller.h.

Member Typedef Documentation

◆ interface_t

Definition at line 14 of file vvl_controller.h.

Member Function Documentation

◆ getFuelCoefficient()

float VvlController::getFuelCoefficient ( ) const

Definition at line 27 of file vvl_controller.cpp.

27 {
28 float result = 1.0f;
29 if (engineConfiguration->vvlControlEnabled && isVvlCondition) {
30 result += engineConfiguration->vvlController.fuelAdderPercent / 100.0f;
31 }
32 return result;
33}
static constexpr engine_configuration_s * engineConfiguration

Referenced by getRunningFuel().

Here is the caller graph for this function:

◆ getTimingModifier()

float VvlController::getTimingModifier ( ) const

Definition at line 35 of file vvl_controller.cpp.

35 {
36 if (engineConfiguration->vvlControlEnabled && isVvlCondition) {
37 // note the "-" here to remove timing!
38 return -engineConfiguration->vvlController.ignitionRetard;
39 }
40 return 0.0f;
41}

Referenced by getRunningAdvance().

Here is the caller graph for this function:

◆ onSlowCallback()

void VvlController::onSlowCallback ( )
overridevirtual

Reimplemented from EngineModule.

Definition at line 11 of file vvl_controller.cpp.

11 {
12 if (engineConfiguration->vvlControlEnabled) {
20 );
21 } else {
22 isVvlCondition = false;
23 }
25}
RegisteredOutputPin vvlRelay
Definition efi_gpio.h:93
void setValue(const char *msg, int logicValue, bool isForce=false)
Definition efi_gpio.cpp:604
void updateTpsConditionSatisfied()
void updateAfrConditionSatisfied()
void updateCltConditionSatisfied()
void updateMapConditionSatisfied()
void updateRpmConditionSatisfied()
EnginePins enginePins
Definition efi_gpio.cpp:24
Here is the call graph for this function:

◆ updateAfrConditionSatisfied()

void VvlController::updateAfrConditionSatisfied ( )
private

Definition at line 70 of file vvl_controller.cpp.

70 {
71 if (static_cast<float>(engineConfiguration->vvlController.maximumAfr) != 0.0f) {
72 const expected<float> lambda1 = Sensor::get(SensorType::Lambda1);
73 if (lambda1.Valid) {
74 const float afr = lambda1.Value * STOICH_RATIO;
75 isVvlAfrCondition = (afr <= static_cast<float>(engineConfiguration->vvlController.maximumAfr));
76 } else {
77 isVvlAfrCondition = false;
78 }
79 } else {
80 isVvlAfrCondition = true;
81 }
82}
virtual SensorResult get() const =0

Referenced by onSlowCallback().

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

◆ updateCltConditionSatisfied()

void VvlController::updateCltConditionSatisfied ( )
private

Definition at line 52 of file vvl_controller.cpp.

52 {
53 if (engineConfiguration->vvlController.minimumClt != 0) {
54 const expected<float> clt = Sensor::get(SensorType::Clt);
55 isVvlCltCondition = clt.Valid && (engineConfiguration->vvlController.minimumClt <= clt.Value);
56 } else {
57 isVvlCltCondition = true;
58 }
59}
static CCM_OPTIONAL FunctionalSensor clt(SensorType::Clt, MS2NT(10))

Referenced by onSlowCallback().

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

◆ updateMapConditionSatisfied()

void VvlController::updateMapConditionSatisfied ( )
private

Definition at line 61 of file vvl_controller.cpp.

61 {
62 if (engineConfiguration->vvlController.maximumMap != 0) {
63 const expected<float> map = Sensor::get(SensorType::Map);
64 isVvlMapCondition = map.Valid && (map.Value <= engineConfiguration->vvlController.maximumMap);
65 } else {
66 isVvlMapCondition = true;
67 }
68}

Referenced by onSlowCallback().

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

◆ updateRpmConditionSatisfied()

void VvlController::updateRpmConditionSatisfied ( )
private

Definition at line 88 of file vvl_controller.cpp.

88 {
89 const expected<float> rpmSensorReading = Sensor::get(SensorType::Rpm);
90 if (rpmSensorReading.Valid) {
91 const float rpm = rpmSensorReading.Value;
92 if (rpmHysteresis.checkIfLimitIsExceeded(
93 rpm,
94 engineConfiguration->vvlController.deactivationRpm,
95 engineConfiguration->vvlController.deactivationRpmWindow
96 )) {
97 isVvlRpmCondition = false;
98 } else {
99 isVvlRpmCondition = (engineConfiguration->vvlController.activationRpm <= rpm);
100 }
101 } else {
102 isVvlRpmCondition = false;
103 }
104}

Referenced by onSlowCallback().

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

◆ updateTpsConditionSatisfied()

void VvlController::updateTpsConditionSatisfied ( )
private

Definition at line 43 of file vvl_controller.cpp.

43 {
44 if (engineConfiguration->vvlController.minimumTps != 0) {
45 const expected<float> tps = Sensor::get(SensorType::DriverThrottleIntent);
46 isVvlTpsCondition = tps.Valid && (engineConfiguration->vvlController.minimumTps <= tps.Value);
47 } else {
48 isVvlTpsCondition = true;
49 }
50}
@ DriverThrottleIntent

Referenced by onSlowCallback().

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

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