parent
8dcb49bdf9
commit
4b0ed3751f
|
@ -63,6 +63,7 @@ public:
|
|||
this->index = index;
|
||||
pid_s *auxPidS = &persistentState.persistentConfiguration.engineConfiguration.auxPid[index];
|
||||
auxPid.initPidClass(auxPidS);
|
||||
table = getFSIOTable(index);
|
||||
}
|
||||
|
||||
int getPeriodMs() override {
|
||||
|
@ -87,8 +88,8 @@ public:
|
|||
}
|
||||
|
||||
|
||||
float value = engine->triggerCentral.vvtPosition; // getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE); // that's temporary
|
||||
float targetValue = fsioTable1.getValue(rpm, getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
float value = engine->triggerCentral.vvtPosition;
|
||||
float targetValue = table->getValue(rpm, getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
percent_t pwm = auxPid.getOutput(targetValue, value);
|
||||
if (engineConfiguration->isVerboseAuxPid1) {
|
||||
|
@ -109,6 +110,7 @@ public:
|
|||
private:
|
||||
Pid auxPid;
|
||||
int index = 0;
|
||||
ValueProvider3D *table = NULL;
|
||||
};
|
||||
|
||||
static AuxPidController instances[AUX_PID_COUNT];
|
||||
|
|
|
@ -636,6 +636,19 @@ static void rpnEval(char *line) {
|
|||
#endif
|
||||
}
|
||||
|
||||
ValueProvider3D *getFSIOTable(int index) {
|
||||
switch (index) {
|
||||
default:
|
||||
return &fsioTable1;
|
||||
case 1:
|
||||
return &fsioTable2;
|
||||
case 2:
|
||||
return &fsioTable3;
|
||||
case 3:
|
||||
return &fsioTable4;
|
||||
}
|
||||
}
|
||||
|
||||
void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||
logger = sharedLogger;
|
||||
|
|
|
@ -30,4 +30,6 @@ float getFsioOutputValue(int index DECLARE_ENGINE_PARAMETER_SUFFIX);
|
|||
void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
ValueProvider3D *getFSIOTable(int index);
|
||||
|
||||
#endif /* LE_FUNCTIONS_H_ */
|
||||
|
|
|
@ -15,11 +15,17 @@
|
|||
// popular left edge of CLT-based correction curves
|
||||
#define CLT_CURVE_RANGE_FROM -40
|
||||
|
||||
class ValueProvider3D {
|
||||
public:
|
||||
virtual float getValue(float xRpm, float y) = 0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* this helper class brings together 3D table with two 2D axis curves
|
||||
*/
|
||||
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE, typename vType, typename kType>
|
||||
class Map3D {
|
||||
class Map3D : public ValueProvider3D {
|
||||
public:
|
||||
explicit Map3D(const char*name);
|
||||
Map3D(const char*name, float multiplier);
|
||||
|
|
Loading…
Reference in New Issue