rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
closed_loop_idle.h
Go to the documentation of this file.
1#pragma once
2#include "engine_module.h"
3#include "rusefi_types.h"
4#include "efi_pid.h"
5#include "sensor.h"
6#include "flash_main.h"
7#include "table_helper.h"
9#include <rusefi/interpolation.h>
10#include <rusefi/timer.h>
11
12constexpr int LTIT_TABLE_SIZE = CLT_IDLE_TABLE_CLT_SIZE;
13
15public:
17 float getLtitFactor(float rpm, float clt) const;
18 void update(float rpm, float clt, bool acActive, bool fan1Active, bool fan2Active, float idleIntegral);
19 void smoothLtitTable(float intensity);
20 void onIgnitionStateChanged(bool ignitionOn);
21 void checkIfShouldSave();
22 bool updatedLtit = false;
23
24 // Load data from flash to helper table
25 virtual void loadLtitFromConfig();
26 // Check if table has valid data
27 bool hasValidData() const;
28
29#ifndef EFI_UNIT_TEST
30private:
31#endif
34
35 // Timers for control
39
40 bool m_ignitionState = false;
41
42 // Learning state management
43 bool m_pendingSave = false;
44
45 // Validation helpers
46 bool isValidConditionsForLearning(float idleIntegral) const;
48};
float ltitTableHelper[LTIT_TABLE_SIZE]
float getLtitFactor(float rpm, float clt) const
virtual void loadLtitFromConfig()
bool hasValidData() const
void onIgnitionStateChanged(bool ignitionOn)
void update(float rpm, float clt, bool acActive, bool fan1Active, bool fan2Active, float idleIntegral)
void smoothLtitTable(float intensity)
bool isValidConditionsForLearning(float idleIntegral) const
constexpr int LTIT_TABLE_SIZE
static CCM_OPTIONAL FunctionalSensor clt(SensorType::Clt, MS2NT(10))
Base class for sensors. Inherit this class to implement a new type of sensor.