Live Data: more Idle & ETB data points!

This commit is contained in:
rusefi 2019-09-01 15:46:40 -04:00
parent abf2406621
commit ebcb0cdf4c
10 changed files with 84 additions and 15 deletions

View File

@ -90,6 +90,16 @@
#if EFI_TUNER_STUDIO
#ifndef EFI_IDLE_CONTROL
#if EFI_IDLE_INCREMENTAL_PID_CIC
extern PidCic idlePid;
#else
extern Pid idlePid;
#endif /* EFI_IDLE_INCREMENTAL_PID_CIC */
#endif /* EFI_IDLE_CONTROL */
EXTERN_ENGINE
;
@ -268,7 +278,8 @@ static const void * getStructAddr(int structId) {
#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
#ifndef EFI_IDLE_CONTROL
// todo case LDS_IDLE_PID_STATE_INDEX:
case LDS_IDLE_PID_STATE_INDEX:
return static_cast<pid_state_s*>(&idlePid);
#endif /* EFI_IDLE_CONTROL */
default:

View File

@ -171,8 +171,6 @@ static percent_t currentEtbDuty;
class EtbController : public PeriodicTimerController {
percent_t feedForward = 0;
int getPeriodMs() override {
return GET_PERIOD_LIMITED(&engineConfiguration->etb);
}
@ -182,7 +180,7 @@ class EtbController : public PeriodicTimerController {
if (engineConfiguration->debugMode == DBG_ELECTRONIC_THROTTLE_PID) {
#if EFI_TUNER_STUDIO
etbPid.postState(&tsOutputChannels);
tsOutputChannels.debugIntField5 = feedForward;
tsOutputChannels.debugIntField5 = engine->engineState.etbFeedForward;
#endif /* EFI_TUNER_STUDIO */
} else if (engineConfiguration->debugMode == DBG_ELECTRONIC_THROTTLE_EXTRA) {
#if EFI_TUNER_STUDIO
@ -242,12 +240,12 @@ class EtbController : public PeriodicTimerController {
#endif /* EFI_TUNER_STUDIO */
}
feedForward = interpolate2d("etbb", targetPosition, engineConfiguration->etbBiasBins, engineConfiguration->etbBiasValues);
engine->engineState.etbFeedForward = interpolate2d("etbb", targetPosition, engineConfiguration->etbBiasBins, engineConfiguration->etbBiasValues);
etbPid.iTermMin = engineConfiguration->etb_iTermMin;
etbPid.iTermMax = engineConfiguration->etb_iTermMax;
currentEtbDuty = feedForward +
currentEtbDuty = engine->engineState.etbFeedForward +
etbPid.getOutput(targetPosition, actualThrottlePosition);
etb1.dcMotor.Set(ETB_PERCENT_TO_DUTY(currentEtbDuty));
@ -267,6 +265,10 @@ DISPLAY(DISPLAY_IF(hasEtbPedalPositionSensor))
DISPLAY(DISPLAY_CONFIG(throttlePedalPositionAdcChannel));
DISPLAY_TEXT(eol);
DISPLAY_TEXT(Feed_forward);
DISPLAY(DISPLAY_FIELD(etbFeedForward));
DISPLAY_TEXT(eol);
DISPLAY_STATE(ETB_pid)
DISPLAY_TEXT(Output);
DISPLAY(DISPLAY_FIELD(output));

View File

@ -59,9 +59,9 @@ static bool mightResetPid = false;
#if EFI_IDLE_INCREMENTAL_PID_CIC
// Use new PID with CIC integrator
static PidCic idlePid;
PidCic idlePid;
#else
static Pid idlePid;
Pid idlePid;
#endif /* EFI_IDLE_INCREMENTAL_PID_CIC */
// todo: extract interface for idle valve hardware, with solenoid and stepper implementations?
@ -283,7 +283,9 @@ public:
* @see stepper.cpp
*/
if (engineConfiguration->isVerboseIAC && engineConfiguration->idleMode == IM_AUTO) {
engine->engineState.isAutomaticIdle = engineConfiguration->idleMode == IM_AUTO;
if (engineConfiguration->isVerboseIAC && engine->engineState.isAutomaticIdle) {
// todo: print each bit using 'getIdle_state_e' method
scheduleMsg(logger, "state %d", engine->engineState.idle.idleState);
idlePid.showPidStatus(logger, "idle");
@ -536,6 +538,26 @@ void startIdleThread(Logging*sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
DISPLAY(DISPLAY_FIELD(throttlePedalUpState));
DISPLAY(DISPLAY_CONFIG(throttlePedalUpPin));
DISPLAY_TEXT(eol);
DISPLAY(DISPLAY_IF(isAutomaticIdle))
DISPLAY_STATE(idle_pid)
DISPLAY_TEXT(Output);
DISPLAY(DISPLAY_FIELD(output));
DISPLAY_TEXT(iTerm);
DISPLAY(DISPLAY_FIELD(iTerm));
DISPLAY_TEXT(eol);
DISPLAY_TEXT(Settings);
DISPLAY(DISPLAY_CONFIG(IDLERPMPID_PFACTOR));
DISPLAY(DISPLAY_CONFIG(IDLERPMPID_IFACTOR));
DISPLAY(DISPLAY_CONFIG(IDLERPMPID_DFACTOR));
DISPLAY(DISPLAY_CONFIG(IDLERPMPID_OFFSET));
/* DISPLAY_ELSE */
DISPLAY_TEXT(Manual_idle_control);
/* DISPLAY_ENDIF */
//scheduleMsg(logger, "initial idle %d", idlePositionController.value);

View File

@ -812,6 +812,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20190830;
return 20190901;
}
#endif /* EFI_UNIT_TEST */

View File

@ -1,4 +1,4 @@
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/engine_state.txt Sun Sep 01 11:57:51 EDT 2019
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/engine_state.txt Sun Sep 01 15:38:18 EDT 2019
// by class com.rusefi.output.CHeaderConsumer
// begin
#ifndef CONTROLLERS_GENERATED_ENGINE_STATE_GENERATED_H
@ -198,6 +198,9 @@ struct engine_state2_s {
/**
offset 80 bit 1 */
bool hasEtbPedalPositionSensor : 1;
/**
offset 80 bit 2 */
bool isAutomaticIdle : 1;
/**
* offset 84
*/
@ -206,11 +209,15 @@ struct engine_state2_s {
* offset 104
*/
running_fuel_s running;
/** total size 136*/
/**
* offset 136
*/
percent_t etbFeedForward = (percent_t)0;
/** total size 140*/
};
typedef struct engine_state2_s engine_state2_s;
#endif
// end
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/engine_state.txt Sun Sep 01 11:57:51 EDT 2019
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/engine_state.txt Sun Sep 01 15:38:18 EDT 2019

View File

@ -54,6 +54,7 @@ float baroCorrection;
bit isCrankingState
bit hasEtbPedalPositionSensor;
bit isAutomaticIdle
struct cranking_fuel_s
@ -94,5 +95,7 @@ end_struct
! actually define a member of 'running_fuel_s' type
running_fuel_s running
percent_t etbFeedForward;
! engine_state2_s
end_struct

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated;
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/engine_state.txt Sun Sep 01 11:57:51 EDT 2019
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/engine_state.txt Sun Sep 01 15:38:18 EDT 2019
// by class com.rusefi.output.JavaFieldsConsumer
import com.rusefi.config.*;
@ -28,6 +28,7 @@ public class EngineState {
public static final Field BAROCORRECTION = Field.create("BAROCORRECTION", 76, FieldType.FLOAT);
public static final Field ISCRANKINGSTATE = Field.create("ISCRANKINGSTATE", 80, FieldType.BIT, 0);
public static final Field HASETBPEDALPOSITIONSENSOR = Field.create("HASETBPEDALPOSITIONSENSOR", 80, FieldType.BIT, 1);
public static final Field ISAUTOMATICIDLE = Field.create("ISAUTOMATICIDLE", 80, FieldType.BIT, 2);
public static final Field CRANKING_BASEFUEL = Field.create("CRANKING_BASEFUEL", 84, FieldType.FLOAT);
public static final Field CRANKING_COOLANTTEMPERATURECOEFFICIENT = Field.create("CRANKING_COOLANTTEMPERATURECOEFFICIENT", 88, FieldType.FLOAT);
public static final Field CRANKING_TPSCOEFFICIENT = Field.create("CRANKING_TPSCOEFFICIENT", 92, FieldType.FLOAT);
@ -41,6 +42,7 @@ public class EngineState {
public static final Field RUNNING_PIDCORRECTION = Field.create("RUNNING_PIDCORRECTION", 124, FieldType.FLOAT);
public static final Field RUNNING_BASEFUEL = Field.create("RUNNING_BASEFUEL", 128, FieldType.FLOAT);
public static final Field RUNNING_FUEL = Field.create("RUNNING_FUEL", 132, FieldType.FLOAT);
public static final Field ETBFEEDFORWARD = Field.create("ETBFEEDFORWARD", 136, FieldType.FLOAT);
public static final Field[] VALUES = {
ISTCHARGEAIRMODEL,
AIRMASSINONECYLINDER,
@ -64,6 +66,7 @@ public class EngineState {
BAROCORRECTION,
ISCRANKINGSTATE,
HASETBPEDALPOSITIONSENSOR,
ISAUTOMATICIDLE,
CRANKING_BASEFUEL,
CRANKING_COOLANTTEMPERATURECOEFFICIENT,
CRANKING_TPSCOEFFICIENT,
@ -77,5 +80,6 @@ public class EngineState {
RUNNING_PIDCORRECTION,
RUNNING_BASEFUEL,
RUNNING_FUEL,
ETBFEEDFORWARD,
};
}

View File

@ -48,7 +48,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel
*/
public class Launcher {
public static final int CONSOLE_VERSION = 20190830;
public static final int CONSOLE_VERSION = 20190901;
public static final String INI_FILE_PATH = System.getProperty("ini_file_path", "..");
public static final String INPUT_FILES_PATH = System.getProperty("input_files_path", "..");
public static final String TOOLS_PATH = System.getProperty("tools_path", ".");

View File

@ -13,6 +13,9 @@ public class ElectronicThrottleMeta {
new SensorRequest("PPS"),
new ConfigRequest("throttlePedalPositionAdcChannel"),
new TextRequest("eol"),
new TextRequest("Feed_forward"),
new FieldRequest("Engine", "etbFeedForward"),
new TextRequest("eol"),
new TextRequest("Output"),
new FieldRequest("ETB_pid", "output"),
new TextRequest("iTerm"),

View File

@ -18,5 +18,22 @@ public class IdleThreadMeta {
new TextRequest("Throttle_Up_State"),
new FieldRequest("Engine", "throttlePedalUpState"),
new ConfigRequest("throttlePedalUpPin"),
new TextRequest("eol"),
new IfRequest("Engine", "isAutomaticIdle",
new Request[]{
new TextRequest("Output"),
new FieldRequest("idle_pid", "output"),
new TextRequest("iTerm"),
new FieldRequest("idle_pid", "iTerm"),
new TextRequest("eol"),
new TextRequest("Settings"),
new ConfigRequest("IDLERPMPID_PFACTOR"),
new ConfigRequest("IDLERPMPID_IFACTOR"),
new ConfigRequest("IDLERPMPID_DFACTOR"),
new ConfigRequest("IDLERPMPID_OFFSET"),
},
new Request[]{
new TextRequest("Manual_idle_control"),
}),
};
}