rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions
RotationalIdle Class Reference

#include <rotational_idle.h>

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

Public Member Functions

 RotationalIdle ()
 
bool shouldEngageRotationalIdle ()
 
bool shouldSkipSparkRotationalIdle ()
 

Additional Inherited Members

- Data Fields inherited from live_data_rotational_idle_s
bool rotationalIdleEngaged: 1 {}
 
bool rotIdleEngineTooSlow: 1 {}
 
bool rotIdleEngineTooFast: 1 {}
 
bool rotIdleEngineTooLowClt: 1 {}
 
bool rotIdleEngineTooHot: 1 {}
 
bool rotIdleTpsTooHigh: 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 rotational_idle.h.

Constructor & Destructor Documentation

◆ RotationalIdle()

RotationalIdle::RotationalIdle ( )

Definition at line 4 of file rotational_idle.cpp.

4 {
5
6}

Member Function Documentation

◆ shouldEngageRotationalIdle()

bool RotationalIdle::shouldEngageRotationalIdle ( )

Definition at line 8 of file rotational_idle.cpp.

8 {
10
12 return false;
13 }
14
15 //TODO: we need to use deadbands ond this!! (and on the tps/pps)
18 return true;
19 }
20
21 // TODO: auto_engage sounds too generic, maybe better auto_engage_pps_enable?
24 return true; // tps is below the maximum
25 }
26
27 return false;
28}
static float getOrZero(SensorType type)
Definition sensor.h:87
static constexpr engine_configuration_s * engineConfiguration
@ DriverThrottleIntent

Referenced by shouldSkipSparkRotationalIdle().

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

◆ shouldSkipSparkRotationalIdle()

bool RotationalIdle::shouldSkipSparkRotationalIdle ( )

Determines whether to skip spark based on rotational idle skip pattern configuration.

The skip pattern works using modulo arithmetic with configurable accumulators:

  • Each accumulator has: acc_max (pattern period), acc_adder (phase shift), acc_offset (cylinder offset)
  • For each accumulator: counter = globalSparkCounter + offset + acc_offset
  • Skip condition: ((counter % acc_max) + acc_adder) >= acc_max

Example with acc_max=2, acc_adder=1, acc_offset=0: counter=0: (0 % 2) + 1 = 1 < 2 -> fire spark counter=1: (1 % 2) + 1 = 2 >= 2 -> skip spark counter=2: (2 % 2) + 1 = 1 < 2 -> fire spark counter=3: (3 % 2) + 1 = 2 >= 2 -> skip spark

If acc_max=0, that accumulator is disabled and won't skip.

Returns
True if should skip a spark event.

Definition at line 55 of file rotational_idle.cpp.

55 {
56 bool result = false;
58
59 if (cutMode == RotationalCutMode::Fuel) {
60 return false;
61 }
62
65 return false;
66 }
67
69
70
71 for (size_t i = 0; i < efi::size(engineConfiguration->rotationalIdleController.accumulators); i++){
73
74 uint32_t counter = engine->engineState.globalSparkCounter + accConfig.acc_offset;
75 result |= calculateSkip(counter, accConfig.acc_max, accConfig.acc_adder);
76 }
77
78 return result;
79}
EngineState engineState
Definition engine.h:352
bool shouldEngageRotationalIdle()
static EngineAccessor engine
Definition engine.h:415
static bool calculateSkip(uint32_t counter, uint8_t max, uint8_t adder)
Here is the call graph for this function:

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