rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
injector_model.h
Go to the documentation of this file.
1#pragma once
2
3#include <rusefi/expected.h>
5#include "engine_module.h"
6
7struct IInjectorModel : public EngineModule {
8 virtual void prepare() = 0;
9 virtual floatms_t getInjectionDuration(float fuelMassGram) const = 0;
10 virtual float getFuelMassForDuration(floatms_t duration) const = 0;
11 virtual floatms_t getDeadtime() const = 0;
12};
13
15public:
16 void prepare() override;
17 floatms_t getInjectionDuration(float fuelMassGram) const override;
18 float getFuelMassForDuration(floatms_t duration) const override;
19
20 virtual float getInjectorFlowRatio() = 0;
21 virtual void updateState() = 0;
22 virtual expected<float> getFuelDifferentialPressure() const = 0;
23 virtual expected<float> getFuelPressure() const = 0;
24
25 virtual float getBaseFlowRate() const = 0;
26
28 floatms_t getBaseDurationImpl(float fuelMassGram) const;
30
31 // Ford small pulse model
32 virtual float getSmallPulseFlowRate() const = 0;
33 virtual float getSmallPulseBreakPoint() const = 0;
34
35private:
36 // Mass flow rate for large-pulse flow, g/s
37 float m_massFlowRate = 0;
38
39 // Break point below which the "small pulse" slope is used, grams
41
42 // Flow rate for small pulses, g/s
44
45 // Correction adder for small pulses to correct for small/large pulse kink, ms
47};
48
50public:
51 InjectorModelWithConfig(const injector_s* const cfg);
52
53 floatms_t getDeadtime() const override;
54 float getBaseFlowRate() const override;
55 float getInjectorFlowRatio() override;
56 void updateState() override;
57 expected<float> getFuelDifferentialPressure() const override;
58 expected<float> getFuelPressure() const override;
59 floatms_t getInjectionDuration(float fuelMassGram) const override;
60
61 using interface_t = IInjectorModel; // Mock interface
62private:
64 [[nodiscard]] virtual float getFuelReferencePressure() const = 0;
65
66 const injector_s* const m_cfg;
67};
68
71
73
74 // Ford small pulse model
75 float getSmallPulseFlowRate() const override;
76 float getSmallPulseBreakPoint() const override;
77private:
79 [[nodiscard]] float getFuelReferencePressure() const final;
80};
81
84
86
87 // Ford small pulse model
88 float getSmallPulseFlowRate() const override;
89 float getSmallPulseBreakPoint() const override;
90private:
92 [[nodiscard]] float getFuelReferencePressure() const final;
93};
floatms_t getBaseDurationImpl(float fuelMassGram) const
float getFuelMassForDuration(floatms_t duration) const override
virtual float getInjectorFlowRatio()=0
virtual float getBaseFlowRate() const =0
virtual float getSmallPulseFlowRate() const =0
virtual void updateState()=0
virtual expected< float > getFuelPressure() const =0
virtual expected< float > getFuelDifferentialPressure() const =0
virtual floatms_t correctInjectionPolynomial(float floatms_t) const
virtual float getSmallPulseBreakPoint() const =0
void prepare() override
virtual InjectorNonlinearMode getNonlinearMode() const =0
floatms_t getInjectionDuration(float fuelMassGram) const override
expected< float > getFuelPressure() const override
void updateState() override
const injector_s *const m_cfg
virtual float getFuelReferencePressure() const =0
virtual injector_compensation_mode_e getInjectorCompensationMode() const =0
float getBaseFlowRate() const override
float getInjectorFlowRatio() override
floatms_t getInjectionDuration(float fuelMassGram) const override
expected< float > getFuelDifferentialPressure() const override
floatms_t getDeadtime() const override
InjectorNonlinearMode
injector_compensation_mode_e
virtual float getFuelMassForDuration(floatms_t duration) const =0
virtual floatms_t getInjectionDuration(float fuelMassGram) const =0
virtual void prepare()=0
virtual floatms_t getDeadtime() const =0
float getSmallPulseBreakPoint() const override
float getSmallPulseFlowRate() const override
float getFuelReferencePressure() const final
InjectorNonlinearMode getNonlinearMode() const override
injector_compensation_mode_e getInjectorCompensationMode() const final
InjectorNonlinearMode getNonlinearMode() const override
float getFuelReferencePressure() const final
float getSmallPulseFlowRate() const override
float getSmallPulseBreakPoint() const override
injector_compensation_mode_e getInjectorCompensationMode() const final