This commit is contained in:
rusefi 2020-11-23 01:10:12 -05:00
parent 6334e5011f
commit b329cc66ed
4 changed files with 12 additions and 6 deletions

View File

@ -604,7 +604,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
// Low pressure is directly in kpa
tsOutputChannels->lowFuelPressure = Sensor::get(SensorType::FuelPressureLow).Value;
// High pressure is in bar, aka 100 kpa
tsOutputChannels->highFuelPressure = Sensor::get(SensorType::FuelPressureHigh).Value * 0.01f;
tsOutputChannels->highFuelPressure = KPA2BAR(Sensor::get(SensorType::FuelPressureHigh).Value);
// 288
tsOutputChannels->injectionOffset = engine->engineState.injectionOffset;

View File

@ -10,6 +10,7 @@
#include "high_pressure_fuel_pump.h"
#include "spark_logic.h"
#include "map.h"
#if EFI_HPFP
@ -58,7 +59,11 @@ static void handle(HpfpActor *actor) {
void hpfpPlainPinTurnOn(HpfpActor *current) {
RegisteredNamedOutputPin *output = &enginePins.hpfpValve;
output->setHigh();
int highPressureKpa = Sensor::get(SensorType::FuelPressureHigh).Value;
// very basic control strategy
if (highPressureKpa < BAR2KPA(50)) {
output->setHigh();
}
handle(current);
}

View File

@ -31,10 +31,11 @@ float validateMap(float mapKPa DECLARE_ENGINE_PARAMETER_SUFFIX);
#define PSI2KPA(psi) (KPA_PER_PSI * (psi))
#define BAR2KPA(bar) (100 * (bar))
#define KPA2BAR(kpa) (0.01f * (kpa))
// PSI (relative to atmosphere) to kPa (relative to vacuum)
#define PSI2KPA_RELATIVE(psi) (101.32500411216164f + PSI2KPA(psi))
#define INHG2KPA(inhg) ((inhg) * 3.386375)
#define KPA2INHG(kpa) ((kpa) / 3.386375)
#define INHG2KPA(inhg) ((inhg) * 3.386375f)
#define KPA2INHG(kpa) ((kpa) / 3.386375f)

View File

@ -26,8 +26,8 @@ enum class SensorType : unsigned char {
OilPressure,
FuelPressureLow,
FuelPressureHigh,
FuelPressureLow, // in kPa
FuelPressureHigh, // in kPa
FuelPressureInjector,
// This is the "resolved" position, potentially composited out of the following two