This commit is contained in:
rusefi 2017-03-07 01:28:26 -05:00
parent 6798352dfd
commit 058421cc7d
5 changed files with 19 additions and 5 deletions

View File

@ -100,9 +100,9 @@ typedef struct {
*/
float engineLoadAccelExtra; // offset 124
float tpsAccelFuel; // offset 128
float baroCorrection;
float pedalPosition;
float injectorDutyCycle;
float baroCorrection; // 132
float pedalPosition; // 138
float injectorDutyCycle; // 140
int knockCount; // 144
float fuelTankGauge; // 148
float knockLevel; // 152
@ -150,7 +150,8 @@ typedef struct {
float debugFloatField7; // 260
int firmwareVersion; // 264
float fuelPidCorrection; // 268
int unused3[21];
float coilDutyCycle; // 272
int unused3[20];
} TunerStudioOutputChannels;
#endif /* TUNERSTUDIO_CONFIGURATION_H_ */

View File

@ -49,6 +49,7 @@
#include "fuel_math.h"
#include "main_trigger_callback.h"
#include "engine_math.h"
#include "spark_logic.h"
#include "idle_thread.h"
#include "engine_configuration.h"
#include "rfiutil.h"
@ -718,6 +719,8 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->fuelBase = engine->engineState.baseFuel;
tsOutputChannels->actualLastInjection = ENGINE(actualLastInjection);
tsOutputChannels->coilDutyCycle = getCoilDutyCycle(rpm PASS_ENGINE_PARAMETER);
efitimesec_t now = getTimeNowSeconds();
tsOutputChannels->timeSeconds = now;
tsOutputChannels->firmwareVersion = getRusEfiVersion();

View File

@ -95,6 +95,7 @@ angle_t getinjectionOffset(float rpm DECLARE_ENGINE_PARAMETER_S) {
/**
* Number of injections into each cylinder per engine cycle
* @see getNumberOfSparks
*/
int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_S) {
switch (mode) {
@ -110,6 +111,9 @@ int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_S) {
}
}
/**
* @see getCoilDutyCycle
*/
percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_S) {
floatms_t totalPerCycle = getInjectionDuration(rpm PASS_ENGINE_PARAMETER) * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER);
floatms_t engineCycleDuration = getCrankshaftRevolutionTimeMs(rpm) * (engineConfiguration->operationMode == TWO_STROKE ? 1 : 2);

View File

@ -42,7 +42,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Mar 06 17:05:02 EST 2017
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Mar 06 19:02:13 EST 2017
pageSize = 16376
page = 1
@ -921,6 +921,7 @@ fileVersion = { 20161225 }
debugFloatField7 = scalar, F32, 260, "val", 1, 0.0;
firmwareVersion = scalar,U32, 264, "version_f", 1, 0
fuelPidCorrection = scalar, F32, 268, "ms", 1, 0
coilDutyCycle = scalar, F32, 272, "perc", 1, 0
egoCorrection = { 100 }
time = { timeNow }
@ -1196,6 +1197,7 @@ fileVersion = { 20161225 }
pulseWidthGauge = pulseWidth, "fuel final squirt, per injection", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
baseFuelGauge = baseFuel, "fuel: base duration, before corr", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
fuelPidCorrectionGauge = fuelPidCorrection, "fuel: closed loop correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1
coilDutyCycleGauge = coilDutyCycle, "dwell: duty cycle", "perc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
crankingFuelGauge = crankingFuel, "fuel: crank Width", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
iatCorrectionGauge = iatCorrection, "fuel: IAT correction", "mult", 0, 3, 0, 0, 3, 3, 2, 2
@ -1305,6 +1307,7 @@ fileVersion = { 20161225 }
entry = fuelPidCorrection,"fuel: pid", float, "%.2f"
entry = veValue, "fuel: VE", float, "%.3f"
entry = injectorDutyCycle,"fuel: duty cyc",float,"%.3f"
entry = coilDutyCycle, "dwell: duty", float,"%.3f"
entry = engineLoadAccelExtra, "fuel: load extra",float, "%.3f"
entry = engineLoadDelta, "fuel: load change",float, "%.3f"

View File

@ -853,6 +853,7 @@ fileVersion = { 20161225 }
debugFloatField7 = scalar, F32, 260, "val", 1, 0.0;
firmwareVersion = scalar,U32, 264, "version_f", 1, 0
fuelPidCorrection = scalar, F32, 268, "ms", 1, 0
coilDutyCycle = scalar, F32, 272, "perc", 1, 0
egoCorrection = { 100 }
time = { timeNow }
@ -1128,6 +1129,7 @@ fileVersion = { 20161225 }
pulseWidthGauge = pulseWidth, "fuel final squirt, per injection", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
baseFuelGauge = baseFuel, "fuel: base duration, before corr", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
fuelPidCorrectionGauge = fuelPidCorrection, "fuel: closed loop correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1
coilDutyCycleGauge = coilDutyCycle, "dwell: duty cycle", "perc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
crankingFuelGauge = crankingFuel, "fuel: crank Width", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
iatCorrectionGauge = iatCorrection, "fuel: IAT correction", "mult", 0, 3, 0, 0, 3, 3, 2, 2
@ -1237,6 +1239,7 @@ fileVersion = { 20161225 }
entry = fuelPidCorrection,"fuel: pid", float, "%.2f"
entry = veValue, "fuel: VE", float, "%.3f"
entry = injectorDutyCycle,"fuel: duty cyc",float,"%.3f"
entry = coilDutyCycle, "dwell: duty", float,"%.3f"
entry = engineLoadAccelExtra, "fuel: load extra",float, "%.3f"
entry = engineLoadDelta, "fuel: load change",float, "%.3f"