parent
abfdfe6896
commit
c938b0d374
|
@ -223,9 +223,7 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
|
||||||
void EngineState::updateTChargeK(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
void EngineState::updateTChargeK(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
float coolantC = ENGINE(sensors.clt);
|
float newTCharge = getTCharge(rpm, tps, getCoolantTemperature(), getIntakeAirTemperature() PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
float intakeC = ENGINE(sensors.iat);
|
|
||||||
float newTCharge = getTCharge(rpm, tps, coolantC, intakeC PASS_ENGINE_PARAMETER_SUFFIX);
|
|
||||||
// convert to microsecs and then to seconds
|
// convert to microsecs and then to seconds
|
||||||
efitick_t curTime = getTimeNowNt();
|
efitick_t curTime = getTimeNowNt();
|
||||||
float secsPassed = (float)NT2US(curTime - timeSinceLastTChargeK) / 1000000.0f;
|
float secsPassed = (float)NT2US(curTime - timeSinceLastTChargeK) / 1000000.0f;
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "tps.h"
|
#include "tps.h"
|
||||||
#include "engine_math.h"
|
#include "engine_math.h"
|
||||||
#include "fuel_math.h"
|
#include "fuel_math.h"
|
||||||
#include "allsensors.h"
|
#include "thermistors.h"
|
||||||
|
|
||||||
extern CANTxFrame txmsg;
|
extern CANTxFrame txmsg;
|
||||||
|
|
||||||
|
|
|
@ -337,7 +337,7 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int injEventIndex, InjectionE
|
||||||
static void fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
static void fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if ! EFI_UNIT_TEST
|
#if ! EFI_UNIT_TEST
|
||||||
if (GET_RPM_VALUE < CONFIG(fuelClosedLoopRpmThreshold) ||
|
if (GET_RPM_VALUE < CONFIG(fuelClosedLoopRpmThreshold) ||
|
||||||
ENGINE(sensors.clt) < CONFIG(fuelClosedLoopCltThreshold) ||
|
getCoolantTemperature() < CONFIG(fuelClosedLoopCltThreshold) ||
|
||||||
getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) > CONFIG(fuelClosedLoopTpsThreshold) ||
|
getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) > CONFIG(fuelClosedLoopTpsThreshold) ||
|
||||||
ENGINE(sensors.currentAfr) < CONFIGB(fuelClosedLoopAfrLowThreshold) ||
|
ENGINE(sensors.currentAfr) < CONFIGB(fuelClosedLoopAfrLowThreshold) ||
|
||||||
ENGINE(sensors.currentAfr) > engineConfiguration->fuelClosedLoopAfrHighThreshold) {
|
ENGINE(sensors.currentAfr) > engineConfiguration->fuelClosedLoopAfrHighThreshold) {
|
||||||
|
@ -578,7 +578,7 @@ void startPrimeInjectionPulse(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
// If 'primeInjFalloffTemperature' is not specified (by default), we have a prime pulse deactivation at zero celsius degrees, which is okay.
|
// If 'primeInjFalloffTemperature' is not specified (by default), we have a prime pulse deactivation at zero celsius degrees, which is okay.
|
||||||
const float maxPrimeInjAtTemperature = -40.0f; // at this temperature the pulse is maximal.
|
const float maxPrimeInjAtTemperature = -40.0f; // at this temperature the pulse is maximal.
|
||||||
floatms_t pulseLength = interpolateClamped(maxPrimeInjAtTemperature, CONFIG(startOfCrankingPrimingPulse),
|
floatms_t pulseLength = interpolateClamped(maxPrimeInjAtTemperature, CONFIG(startOfCrankingPrimingPulse),
|
||||||
CONFIG(primeInjFalloffTemperature), 0.0f, ENGINE(sensors.clt));
|
CONFIG(primeInjFalloffTemperature), 0.0f, getCoolantTemperature());
|
||||||
if (pulseLength > 0) {
|
if (pulseLength > 0) {
|
||||||
startSimultaniousInjection(engine);
|
startSimultaniousInjection(engine);
|
||||||
efitimeus_t turnOffDelayUs = (efitimeus_t)efiRound(MS2US(pulseLength), 1.0f);
|
efitimeus_t turnOffDelayUs = (efitimeus_t)efiRound(MS2US(pulseLength), 1.0f);
|
||||||
|
|
|
@ -85,11 +85,10 @@ TEST(misc, testFuelMap) {
|
||||||
|
|
||||||
setFlatInjectorLag(0 PASS_CONFIG_PARAMETER_SUFFIX);
|
setFlatInjectorLag(0 PASS_CONFIG_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
float iat = getIntakeAirTemperature();
|
ASSERT_FALSE(cisnan(getIntakeAirTemperature()));
|
||||||
ASSERT_FALSE(cisnan(iat));
|
|
||||||
float iatCorrection = getIatFuelCorrection(-KELV PASS_ENGINE_PARAMETER_SUFFIX);
|
float iatCorrection = getIatFuelCorrection(-KELV PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
ASSERT_EQ( 2, iatCorrection) << "IAT";
|
ASSERT_EQ( 2, iatCorrection) << "IAT";
|
||||||
engine->sensors.clt = getCoolantTemperature();
|
ASSERT_FALSE(cisnan(getCoolantTemperature()));
|
||||||
float cltCorrection = getCltFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
float cltCorrection = getCltFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
ASSERT_EQ( 1, cltCorrection) << "CLT";
|
ASSERT_EQ( 1, cltCorrection) << "CLT";
|
||||||
float injectorLag = getInjectorLag(getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX);
|
float injectorLag = getInjectorLag(getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "fsio_impl.h"
|
#include "fsio_impl.h"
|
||||||
#include "cli_registry.h"
|
#include "cli_registry.h"
|
||||||
#include "engine_test_helper.h"
|
#include "engine_test_helper.h"
|
||||||
|
#include "thermistors.h"
|
||||||
|
|
||||||
#define TEST_POOL_SIZE 256
|
#define TEST_POOL_SIZE 256
|
||||||
|
|
||||||
|
@ -19,7 +20,7 @@ float getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
case LE_METHOD_FAN:
|
case LE_METHOD_FAN:
|
||||||
return engine->fsioState.mockFan;
|
return engine->fsioState.mockFan;
|
||||||
case LE_METHOD_COOLANT:
|
case LE_METHOD_COOLANT:
|
||||||
return engine->sensors.clt;
|
return getCoolantTemperature();
|
||||||
case LE_METHOD_RPM:
|
case LE_METHOD_RPM:
|
||||||
return engine->fsioState.mockRpm;
|
return engine->fsioState.mockRpm;
|
||||||
case LE_METHOD_CRANKING_RPM:
|
case LE_METHOD_CRANKING_RPM:
|
||||||
|
|
Loading…
Reference in New Issue