mirror of https://github.com/rusefi/rusefi-1.git
Fuel pump should turn on at the first sign of engine rotation #1961
This commit is contained in:
parent
0ba97379fb
commit
c36f76b68e
|
@ -80,6 +80,7 @@ public:
|
||||||
explicit Engine(persistent_config_s *config);
|
explicit Engine(persistent_config_s *config);
|
||||||
Engine();
|
Engine();
|
||||||
bool isPwmEnabled = true;
|
bool isPwmEnabled = true;
|
||||||
|
int triggerActivitySecond = 0;
|
||||||
|
|
||||||
IEtbController *etbControllers[ETB_COUNT] = {nullptr};
|
IEtbController *etbControllers[ETB_COUNT] = {nullptr};
|
||||||
IFuelComputer *fuelComputer = nullptr;
|
IFuelComputer *fuelComputer = nullptr;
|
||||||
|
|
|
@ -56,6 +56,7 @@ typedef enum {
|
||||||
LE_METHOD_FSIO_DIGITAL_INPUT = 123,
|
LE_METHOD_FSIO_DIGITAL_INPUT = 123,
|
||||||
LE_METHOD_FSIO_SETTING = 124,
|
LE_METHOD_FSIO_SETTING = 124,
|
||||||
LE_METHOD_PPS = 125,
|
LE_METHOD_PPS = 125,
|
||||||
|
LE_METHOD_TIME_SINCE_TRIGGER_EVENT = 126,
|
||||||
|
|
||||||
#include "fsio_enums_generated.def"
|
#include "fsio_enums_generated.def"
|
||||||
|
|
||||||
|
|
|
@ -139,6 +139,7 @@ FsioValue getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
case LE_METHOD_EXHAUST_VVT:
|
case LE_METHOD_EXHAUST_VVT:
|
||||||
return engine->triggerCentral.getVVTPosition();
|
return engine->triggerCentral.getVVTPosition();
|
||||||
#endif
|
#endif
|
||||||
|
case LE_METHOD_TIME_SINCE_TRIGGER_EVENT:
|
||||||
case LE_METHOD_TIME_SINCE_BOOT:
|
case LE_METHOD_TIME_SINCE_BOOT:
|
||||||
#if EFI_MAIN_RELAY_CONTROL
|
#if EFI_MAIN_RELAY_CONTROL
|
||||||
// in main relay control mode, we return the number of seconds since the ignition is turned on
|
// in main relay control mode, we return the number of seconds since the ignition is turned on
|
||||||
|
@ -781,7 +782,7 @@ void runHardcodedFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
}
|
}
|
||||||
// see FUEL_PUMP_LOGIC
|
// see FUEL_PUMP_LOGIC
|
||||||
if (CONFIG(fuelPumpPin) != GPIO_UNASSIGNED) {
|
if (CONFIG(fuelPumpPin) != GPIO_UNASSIGNED) {
|
||||||
enginePins.fuelPumpRelay.setValue((getTimeNowSeconds() < engineConfiguration->startUpFuelPumpDuration) || (engine->rpmCalculator.getRpm() > 0));
|
enginePins.fuelPumpRelay.setValue((getTimeNowSeconds() < engine->triggerActivitySecond + engineConfiguration->startUpFuelPumpDuration) || (engine->rpmCalculator.getRpm() > 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
enginePins.o2heater.setValue(engine->rpmCalculator.isRunning());
|
enginePins.o2heater.setValue(engine->rpmCalculator.isRunning());
|
||||||
|
|
|
@ -406,6 +406,14 @@ void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE
|
||||||
int rpm = GET_RPM();
|
int rpm = GET_RPM();
|
||||||
if (rpm == 0) {
|
if (rpm == 0) {
|
||||||
// this happens while we just start cranking
|
// this happens while we just start cranking
|
||||||
|
/**
|
||||||
|
* While we have start-up priming pulse, we also want to start pumping fuel again as soon as possible.
|
||||||
|
* Hopefully battery would handle both cranking and fuel pump simultaneously?
|
||||||
|
*/
|
||||||
|
enginePins.fuelPumpRelay.setValue(true); // quickly set pin right from the callback here! todo: would it work OK for smart SPI pin?!
|
||||||
|
#if EFI_PROD_CODE
|
||||||
|
engine->triggerActivitySecond = getTimeNowSeconds();
|
||||||
|
#endif
|
||||||
// todo: check for 'trigger->is_synchnonized?'
|
// todo: check for 'trigger->is_synchnonized?'
|
||||||
// TODO: add 'pin shutdown' invocation somewhere - coils might be still open here!
|
// TODO: add 'pin shutdown' invocation somewhere - coils might be still open here!
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -13,6 +13,11 @@
|
||||||
# (self and (coolant > fan_off_setting)) | (coolant > fan_on_setting) | is_clt_broken
|
# (self and (coolant > fan_off_setting)) | (coolant > fan_on_setting) | is_clt_broken
|
||||||
FAN_CONTROL_LOGIC=(fan and (coolant > cfg_fanOffTemperature)) | (coolant > cfg_fanOnTemperature) | is_clt_broken
|
FAN_CONTROL_LOGIC=(fan and (coolant > cfg_fanOffTemperature)) | (coolant > cfg_fanOnTemperature) | is_clt_broken
|
||||||
|
|
||||||
|
#
|
||||||
|
# todo: we might have a bug here?
|
||||||
|
# todo: 'time_since_boot' means 'getTimeIgnitionSeconds' in case of EFI_MAIN_RELAY_CONTROL like Proteus
|
||||||
|
# and it's negative if ignition is off? does Proteus not get fuel pump start-up priming pulse?!
|
||||||
|
#
|
||||||
FUEL_PUMP_LOGIC=((time_since_boot >= 0) & (time_since_boot < startup_fuel_pump_duration)) | (rpm > 0)
|
FUEL_PUMP_LOGIC=((time_since_boot >= 0) & (time_since_boot < startup_fuel_pump_duration)) | (rpm > 0)
|
||||||
|
|
||||||
ALTERNATOR_LOGIC=vbatt < 14.5
|
ALTERNATOR_LOGIC=vbatt < 14.5
|
||||||
|
|
Loading…
Reference in New Issue