Skip to content

Commit

Permalink
live data injector model
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Jul 2, 2023
1 parent 588ad5c commit 565a599
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions firmware/console/binary/output_channels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ uint16_t rpmAcceleration;dRPM;"RPM acceleration",1, 0, 0, 5, 2
int16_t injectionOffset;@@GAUGE_NAME_FUEL_INJECTION_TIMING@@;"deg", 1, 0, 0, 0, 0

! Corrections
! todo: inline this further to injectorModel deadTime
uint16_t autoscale injectorLagMs;@@GAUGE_NAME_INJECTOR_LAG@@;"ms",{1/@@PACK_MULT_MS@@}, 0, 0, 0, 3

! we want a hash of engineMake+engineCode+vehicleName in the log file in order to match TS logs to rusEFI Online tune
uint16_t engineMakeCodeNameCrc16;@@GAUGE_NAME_ENGINE_CRC16@@;"crc16",1, 0, 0, 0, 0
! Wall model AE
Expand Down
3 changes: 0 additions & 3 deletions firmware/console/status_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,6 @@ static void updateFuelCorrections() {
engine->outputChannels.fuelPidCorrection[0] = 100.0f * (engine->stftCorrection[0] - 1.0f);
engine->outputChannels.fuelPidCorrection[1] = 100.0f * (engine->stftCorrection[1] - 1.0f);
engine->outputChannels.Gego = 100.0f * engine->stftCorrection[0];

// get rid of this, have gauges use injector model info directly
engine->outputChannels.injectorLagMs = engine->module<InjectorModel>()->getDeadtime();
}

static void updateFuelResults() {
Expand Down
6 changes: 3 additions & 3 deletions firmware/controllers/algo/fuel/injector_model.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
struct_no_prefix injector_model_s
float m_deadtime;injectorLag(VBatt)\nthis value depends on a slow-changing VBatt value, so\nwe update it once in a while
float m_deadtime;@@GAUGE_NAME_INJECTOR_LAG@@;"ms",1, 0, 0, 0, 3

float pressureDelta;fuel: injector pressureDelta;"kPa", 1, 0, -10000, 10000, 1
float pressureRatio;fuel: injector pressureRatio;"", 1, 0, -10000, 10000, 3
float pressureDelta;fuel: Injector pressure delta;"kPa", 1, 0, -1000, 1000, 1
float pressureRatio;fuel: Injector pressure ratio;"", 1, 0, 0, 100, 3

end_struct
3 changes: 3 additions & 0 deletions firmware/integration/LiveData.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ Usages:
- name: injector_model
java: InjectorModel.java
folder: controllers/algo/fuel
prepend: integration/rusefi_config_shared.txt
constexpr: "___engine.module<InjectorModel>()"
isPtr: true

- name: launch_control_state
java: LaunchControl.java
Expand Down

0 comments on commit 565a599

Please sign in to comment.