log vvt targets (#3417)

* log vvt target

* java

* make java happy probably

* sensorlogger
This commit is contained in:
Matthew Kennedy 2021-11-02 12:03:57 -07:00 committed by GitHub
parent c23b2aed14
commit 5b35aa8f21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 6 deletions

View File

@ -287,7 +287,10 @@ struct TunerStudioOutputChannels {
scaled_channel<int16_t, PACK_MULT_PERCENT> accelerationZ; // 308 scaled_channel<int16_t, PACK_MULT_PERCENT> accelerationZ; // 308
scaled_channel<int16_t, PACK_MULT_PERCENT> accelerationRoll; // 310 scaled_channel<int16_t, PACK_MULT_PERCENT> accelerationRoll; // 310
scaled_channel<int16_t, PACK_MULT_PERCENT> accelerationYaw; // 312 scaled_channel<int16_t, PACK_MULT_PERCENT> accelerationYaw; // 312
uint8_t unusedAtTheEnd[24]; // we have some unused bytes to allow compatible TS changes
scaled_channel<int8_t> vvtTargets[4]; // 314
uint8_t unusedAtTheEnd[20]; // we have some unused bytes to allow compatible TS changes
// Temporary - will remove soon // Temporary - will remove soon
TsDebugChannels* getDebugChannels() { TsDebugChannels* getDebugChannels() {

View File

@ -67,6 +67,10 @@ static constexpr LogField fields[] = {
{tsOutputChannels.vvtPositionB1E, GAUGE_NAME_VVT_B1E, "deg", 1}, {tsOutputChannels.vvtPositionB1E, GAUGE_NAME_VVT_B1E, "deg", 1},
{tsOutputChannels.vvtPositionB2I, GAUGE_NAME_VVT_B2I, "deg", 1}, {tsOutputChannels.vvtPositionB2I, GAUGE_NAME_VVT_B2I, "deg", 1},
{tsOutputChannels.vvtPositionB2E, GAUGE_NAME_VVT_B2E, "deg", 1}, {tsOutputChannels.vvtPositionB2E, GAUGE_NAME_VVT_B2E, "deg", 1},
{tsOutputChannels.vvtTargets[0], GAUGE_NAME_VVT_TARGET_B1I, "deg", 0},
{tsOutputChannels.vvtTargets[1], GAUGE_NAME_VVT_TARGET_B1E, "deg", 0},
{tsOutputChannels.vvtTargets[2], GAUGE_NAME_VVT_TARGET_B2I, "deg", 0},
{tsOutputChannels.vvtTargets[3], GAUGE_NAME_VVT_TARGET_B2E, "deg", 0},
{tsOutputChannels.wastegatePosition, GAUGE_NAME_WG_POSITION, "%", 2}, {tsOutputChannels.wastegatePosition, GAUGE_NAME_WG_POSITION, "%", 2},
{tsOutputChannels.idlePositionSensor, GAUGE_NAME_IDLE_POSITION, "%", 2}, {tsOutputChannels.idlePositionSensor, GAUGE_NAME_IDLE_POSITION, "%", 2},
{tsOutputChannels.chargeAirMass, GAUGE_NAME_AIR_MASS, "g", 3}, {tsOutputChannels.chargeAirMass, GAUGE_NAME_AIR_MASS, "g", 3},

View File

@ -52,7 +52,13 @@ expected<angle_t> VvtController::observePlant() const {
expected<angle_t> VvtController::getSetpoint() const { expected<angle_t> VvtController::getSetpoint() const {
int rpm = GET_RPM(); int rpm = GET_RPM();
float load = getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE); float load = getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE);
return m_targetMap->getValue(rpm, load); float target = m_targetMap->getValue(rpm, load);
#if EFI_TUNER_STUDIO
tsOutputChannels.vvtTargets[index] = target;
#endif
return target;
} }
expected<percent_t> VvtController::getOpenLoop(angle_t target) const { expected<percent_t> VvtController::getOpenLoop(angle_t target) const {

View File

@ -1626,6 +1626,11 @@ end_struct
#define GAUGE_NAME_VVT_B2I "VVT: bank 2 intake" #define GAUGE_NAME_VVT_B2I "VVT: bank 2 intake"
#define GAUGE_NAME_VVT_B2E "VVT: bank 2 exhaust" #define GAUGE_NAME_VVT_B2E "VVT: bank 2 exhaust"
#define GAUGE_NAME_VVT_TARGET_B1I "VVT: bank 1 intake target"
#define GAUGE_NAME_VVT_TARGET_B1E "VVT: bank 1 exhaust target"
#define GAUGE_NAME_VVT_TARGET_B2I "VVT: bank 2 intake target"
#define GAUGE_NAME_VVT_TARGET_B2E "VVT: bank 2 exhaust target"
#define GAUGE_NAME_DESIRED_GEAR "Desired Gear" #define GAUGE_NAME_DESIRED_GEAR "Desired Gear"
#define GAUGE_NAME_CURRENT_GEAR "Current Gear" #define GAUGE_NAME_CURRENT_GEAR "Current Gear"

View File

@ -416,6 +416,11 @@ enable2ndByteCanID = false
vvtPositionB2I=scalar,S16, 292, "deg",{1/@@PACK_MULT_ANGLE@@}, 0 vvtPositionB2I=scalar,S16, 292, "deg",{1/@@PACK_MULT_ANGLE@@}, 0
vvtPositionB2E=scalar,S16, 294, "deg",{1/@@PACK_MULT_ANGLE@@}, 0 vvtPositionB2E=scalar,S16, 294, "deg",{1/@@PACK_MULT_ANGLE@@}, 0
vvtTargetB1I = scalar, S08, 314, "deg", 1, 0
vvtTargetB1E = scalar, S08, 315, "deg", 1, 0
vvtTargetB2I = scalar, S08, 316, "deg", 1, 0
vvtTargetB2E = scalar, S08, 317, "deg", 1, 0
rawTps1Secondary = scalar, U16, 300, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0 rawTps1Secondary = scalar, U16, 300, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawTps2Primary = scalar, U16, 302, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0 rawTps2Primary = scalar, U16, 302, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawTps2Secondary = scalar, U16, 304, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0 rawTps2Secondary = scalar, U16, 304, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
@ -1059,10 +1064,6 @@ gaugeCategory = Sensors - Extra 1
accelerationRollGauge=accelerationRoll, @@GAUGE_NAME_ACCEL_ROLL@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1 accelerationRollGauge=accelerationRoll, @@GAUGE_NAME_ACCEL_ROLL@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
accelerationYawGauge=accelerationYaw, @@GAUGE_NAME_ACCEL_YAW@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1 accelerationYawGauge=accelerationYaw, @@GAUGE_NAME_ACCEL_YAW@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
atmPresCGauge = baroPressure, @@GAUGE_NAME_BARO_PRESSURE@@, "kPa", 0, 1024, 0, 0, 0, 0, 0, 0 atmPresCGauge = baroPressure, @@GAUGE_NAME_BARO_PRESSURE@@, "kPa", 0, 1024, 0, 0, 0, 0, 0, 0
vvtPositionB1IGauge = vvtPositionB1I, @@GAUGE_NAME_VVT_B1I@@, "deg", -60, 60, -60, -60, 60, 60, 1, 1
vvtPositionB1EGauge = vvtPositionB1E, @@GAUGE_NAME_VVT_B1E@@, "deg", -60, 60, -60, -60, 60, 60, 1, 1
vvtPositionB2IGauge = vvtPositionB2I, @@GAUGE_NAME_VVT_B2I@@, "deg", -60, 60, -60, -60, 60, 60, 1, 1
vvtPositionB2EGauge = vvtPositionB2E, @@GAUGE_NAME_VVT_B2E@@, "deg", -60, 60, -60, -60, 60, 60, 1, 1
internalMcuTemperatureGauge = internalMcuTemperature, @@GAUGE_NAME_ECU_TEMPERATURE@@, "C", 0, 100, 0, 0, 75, 100, 0, 0 internalMcuTemperatureGauge = internalMcuTemperature, @@GAUGE_NAME_ECU_TEMPERATURE@@, "C", 0, 100, 0, 0, 75, 100, 0, 0
OilPressGauge = oilPressure, @@GAUGE_NAME_OIL_PRESSURE@@, @@GAUGE_NAME_OIL_PRESSURE_UNITS@@, 0, 750, 35, 75, 550, 700, 0, 0 OilPressGauge = oilPressure, @@GAUGE_NAME_OIL_PRESSURE@@, @@GAUGE_NAME_OIL_PRESSURE_UNITS@@, 0, 750, 35, 75, 550, 700, 0, 0
idleAirValvePositionGauge = idleAirValvePosition, "Idle position", "%", 0, 100, 0, 0, 100, 100, 1, 1 idleAirValvePositionGauge = idleAirValvePosition, "Idle position", "%", 0, 100, 0, 0, 100, 100, 1, 1
@ -1072,6 +1073,16 @@ gaugeCategory = Sensors - Extra 1
highFuelPressureGauge = highFuelPressure, @@GAUGE_NAME_FUEL_PRESSURE_HIGH@@, @@GAUGE_NAME_FUEL_PRESSURE_HIGH_UNITS@@, 0, 200, 0, 0, 200, 200, 1, 0 highFuelPressureGauge = highFuelPressure, @@GAUGE_NAME_FUEL_PRESSURE_HIGH@@, @@GAUGE_NAME_FUEL_PRESSURE_HIGH_UNITS@@, 0, 200, 0, 0, 200, 200, 1, 0
flexPercentGauge = flexPercent, @@GAUGE_NAME_FLEX@@, "%", 0, 100, 0, 0, 100, 100, 0, 0 flexPercentGauge = flexPercent, @@GAUGE_NAME_FLEX@@, "%", 0, 100, 0, 0, 100, 100, 0, 0
gaugeCategory = VVT
vvtPositionB1IGauge = vvtPositionB1I, @@GAUGE_NAME_VVT_B1I@@, "deg", -60, 60, -60, -60, 60, 60, 1, 1
vvtPositionB1EGauge = vvtPositionB1E, @@GAUGE_NAME_VVT_B1E@@, "deg", -60, 60, -60, -60, 60, 60, 1, 1
vvtPositionB2IGauge = vvtPositionB2I, @@GAUGE_NAME_VVT_B2I@@, "deg", -60, 60, -60, -60, 60, 60, 1, 1
vvtPositionB2EGauge = vvtPositionB2E, @@GAUGE_NAME_VVT_B2E@@, "deg", -60, 60, -60, -60, 60, 60, 1, 1
vvtTargetB1IGauge = vvtTargetB1I, @@GAUGE_NAME_VVT_TARGET_B1I@@, "deg", -60, 60, -60, -60, 60, 60, 0, 0
vvtTargetB1EGauge = vvtTargetB1E, @@GAUGE_NAME_VVT_TARGET_B1E@@, "deg", -60, 60, -60, -60, 60, 60, 0, 0
vvtTargetB2IGauge = vvtTargetB2I, @@GAUGE_NAME_VVT_TARGET_B2I@@, "deg", -60, 60, -60, -60, 60, 60, 0, 0
vvtTargetB2EGauge = vvtTargetB2E, @@GAUGE_NAME_VVT_TARGET_B2E@@, "deg", -60, 60, -60, -60, 60, 60, 0, 0
gaugeCategory = Ignition gaugeCategory = Ignition
ignadvGauge = ignitionAdvance, "Ignition timing", "degrees", -100, 100, -999, -999, 999, 999, 1, 1 ignadvGauge = ignitionAdvance, "Ignition timing", "degrees", -100, 100, -999, -999, 999, 999, 1, 1
dwellGauge = sparkDwellValue, "Dwell", "mSec", 0, 10, 0.5, 1.0, 6.0, 8.0, 1, 1 dwellGauge = sparkDwellValue, "Dwell", "mSec", 0, 10, 0.5, 1.0, 6.0, 8.0, 1, 1
@ -1338,6 +1349,10 @@ gaugeCategory = DynoView
entry = vvtPositionB1E, @@GAUGE_NAME_VVT_B1E@@, float, "%.1f" entry = vvtPositionB1E, @@GAUGE_NAME_VVT_B1E@@, float, "%.1f"
entry = vvtPositionB2I, @@GAUGE_NAME_VVT_B2I@@, float, "%.1f" entry = vvtPositionB2I, @@GAUGE_NAME_VVT_B2I@@, float, "%.1f"
entry = vvtPositionB2E, @@GAUGE_NAME_VVT_B2E@@, float, "%.1f" entry = vvtPositionB2E, @@GAUGE_NAME_VVT_B2E@@, float, "%.1f"
entry = vvtTargetB1I, @@GAUGE_NAME_VVT_TARGET_B1I@@, int, "%d"
entry = vvtTargetB1E, @@GAUGE_NAME_VVT_TARGET_B1E@@, int, "%d"
entry = vvtTargetB2I, @@GAUGE_NAME_VVT_TARGET_B2I@@, int, "%d"
entry = vvtTargetB2E, @@GAUGE_NAME_VVT_TARGET_B2E@@, int, "%d"
entry = injectionOffset, "injOffset" , float, "%.2F" entry = injectionOffset, "injOffset" , float, "%.2F"
; is there a way to log parameter? entry = debugMode, "debugMode",int,"%d" ; is there a way to log parameter? entry = debugMode, "debugMode",int,"%d"

View File

@ -1121,6 +1121,10 @@ public class Fields {
public static final String GAUGE_NAME_VVT_B1I = "VVT: bank 1 intake"; public static final String GAUGE_NAME_VVT_B1I = "VVT: bank 1 intake";
public static final String GAUGE_NAME_VVT_B2E = "VVT: bank 2 exhaust"; public static final String GAUGE_NAME_VVT_B2E = "VVT: bank 2 exhaust";
public static final String GAUGE_NAME_VVT_B2I = "VVT: bank 2 intake"; public static final String GAUGE_NAME_VVT_B2I = "VVT: bank 2 intake";
public static final String GAUGE_NAME_VVT_TARGET_B1E = "VVT: bank 1 exhaust target";
public static final String GAUGE_NAME_VVT_TARGET_B1I = "VVT: bank 1 intake target";
public static final String GAUGE_NAME_VVT_TARGET_B2E = "VVT: bank 2 exhaust target";
public static final String GAUGE_NAME_VVT_TARGET_B2I = "VVT: bank 2 intake target";
public static final String GAUGE_NAME_WARNING_COUNT = "Warning count"; public static final String GAUGE_NAME_WARNING_COUNT = "Warning count";
public static final String GAUGE_NAME_WARNING_COUNTER = "warning: counter"; public static final String GAUGE_NAME_WARNING_COUNTER = "warning: counter";
public static final String GAUGE_NAME_WARNING_LAST = "warning: last"; public static final String GAUGE_NAME_WARNING_LAST = "warning: last";

View File

@ -142,6 +142,11 @@ public enum Sensor {
vvtPositionB2I(GAUGE_NAME_VVT_B2I, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 292, 1.0 / PACK_MULT_ANGLE, 0, 5, "deg"), vvtPositionB2I(GAUGE_NAME_VVT_B2I, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 292, 1.0 / PACK_MULT_ANGLE, 0, 5, "deg"),
vvtPositionB2E(GAUGE_NAME_VVT_B2E, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 294, 1.0 / PACK_MULT_ANGLE, 0, 5, "deg"), vvtPositionB2E(GAUGE_NAME_VVT_B2E, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 294, 1.0 / PACK_MULT_ANGLE, 0, 5, "deg"),
vvtTargetB1I(GAUGE_NAME_VVT_TARGET_B1I, SensorCategory.SENSOR_INPUTS, FieldType.INT8, 314, 1, -50, 50, "deg"),
vvtTargetB1E(GAUGE_NAME_VVT_TARGET_B1E, SensorCategory.SENSOR_INPUTS, FieldType.INT8, 315, 1, -50, 50, "deg"),
vvtTargetB2I(GAUGE_NAME_VVT_TARGET_B2I, SensorCategory.SENSOR_INPUTS, FieldType.INT8, 316, 1, -50, 50, "deg"),
vvtTargetB2E(GAUGE_NAME_VVT_TARGET_B2E, SensorCategory.SENSOR_INPUTS, FieldType.INT8, 317, 1, -50, 50, "deg"),
accelerationZ(GAUGE_NAME_ACCEL_Z, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 308, 1.0 / PACK_MULT_PERCENT, -3, 3, "G"), accelerationZ(GAUGE_NAME_ACCEL_Z, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 308, 1.0 / PACK_MULT_PERCENT, -3, 3, "G"),
accelerationRoll(GAUGE_NAME_ACCEL_ROLL, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 310, 1.0 / PACK_MULT_PERCENT, -30, 30, "deg/s"), accelerationRoll(GAUGE_NAME_ACCEL_ROLL, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 310, 1.0 / PACK_MULT_PERCENT, -30, 30, "deg/s"),
accelerationYaw(GAUGE_NAME_ACCEL_YAW, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 312, 1.0 / PACK_MULT_PERCENT, -30, 30, "deg/s"), accelerationYaw(GAUGE_NAME_ACCEL_YAW, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 312, 1.0 / PACK_MULT_PERCENT, -30, 30, "deg/s"),

View File

@ -63,6 +63,12 @@ public class SensorLogger {
Sensor.vvtPositionB1E, Sensor.vvtPositionB1E,
Sensor.vvtPositionB2I, Sensor.vvtPositionB2I,
Sensor.vvtPositionB2E, Sensor.vvtPositionB2E,
Sensor.vvtTargetB1I,
Sensor.vvtTargetB1E,
Sensor.vvtTargetB2I,
Sensor.vvtTargetB2E,
Sensor.VSS, Sensor.VSS,
Sensor.SPEED2RPM, Sensor.SPEED2RPM,