auto-sync

This commit is contained in:
rusEfi 2016-09-17 21:02:45 -04:00
parent 6a3240ba67
commit a221666897
2 changed files with 18 additions and 2 deletions

View File

@ -27,6 +27,7 @@ static Logging *logger;
extern pin_output_mode_e DEFAULT_OUTPUT; extern pin_output_mode_e DEFAULT_OUTPUT;
extern engine_pins_s enginePins; extern engine_pins_s enginePins;
int alternatorPidResetCounter = 0;
static SimplePwm alternatorControl; static SimplePwm alternatorControl;
static pid_s *altPidS = &persistentState.persistentConfiguration.engineConfiguration.alternatorControl; static pid_s *altPidS = &persistentState.persistentConfiguration.engineConfiguration.alternatorControl;
@ -49,6 +50,7 @@ static msg_t AltCtrlThread(int param) {
while (true) { while (true) {
#if ! EFI_UNIT_TEST || defined(__DOXYGEN__) #if ! EFI_UNIT_TEST || defined(__DOXYGEN__)
if (shouldResetPid) { if (shouldResetPid) {
alternatorPidResetCounter++;
altPid.reset(); altPid.reset();
} }
shouldResetPid = false; shouldResetPid = false;
@ -94,8 +96,9 @@ static msg_t AltCtrlThread(int param) {
if (engineConfiguration->debugMode == ALTERNATOR_PID) { if (engineConfiguration->debugMode == ALTERNATOR_PID) {
tsOutputChannels.debugFloatField1 = currentAltDuty; tsOutputChannels.debugFloatField1 = currentAltDuty;
altPid.postState(&tsOutputChannels); altPid.postState(&tsOutputChannels);
tsOutputChannels.debugIntField3 = alternatorPidResetCounter;
} }
#endif #endif /* !EFI_UNIT_TEST */
alternatorControl.setSimplePwmDutyCycle(currentAltDuty / 100); alternatorControl.setSimplePwmDutyCycle(currentAltDuty / 100);
} }

View File

@ -1211,6 +1211,8 @@ fileVersion = { 20160702 }
entry = massAirFlowValue,"airMass", float, "%.3f" entry = massAirFlowValue,"airMass", float, "%.3f"
entry = pedalPosition, "pedal", float, "%.3f" entry = pedalPosition, "pedal", float, "%.3f"
entry = triggerErrorsCounter, "trg err",int, "%d" entry = triggerErrorsCounter, "trg err",int, "%d"
entry = curIdlePosition, "idle position", float, "%.3f"
entry = pulseWidth, "fuel: pulse", float, "%.3f" entry = pulseWidth, "fuel: pulse", float, "%.3f"
entry = baseFuel, "fuel: base", float, "%.2f" entry = baseFuel, "fuel: base", float, "%.2f"
@ -1232,22 +1234,33 @@ fileVersion = { 20160702 }
entry = sparkDwellValue, "dwell", float,"%.3f" entry = sparkDwellValue, "dwell", float,"%.3f"
entry = debugMode, "debugMode",int,"%d" ; is there a way to log parameter? entry = debugMode, "debugMode",int,"%d"
; Alternator_PID: alternator duty cycle ; Alternator_PID: alternator duty cycle
; DBG_TPS_ACCEL: from TPS ; DBG_TPS_ACCEL: from TPS
entry = debugFloatField1, "debug f1",float,"%.4f" entry = debugFloatField1, "debug f1",float,"%.4f"
; Alternator_PID: current integration term
; DBG_TPS_ACCEL: to TPS ; DBG_TPS_ACCEL: to TPS
entry = debugFloatField2, "debug f2",float,"%.4f" entry = debugFloatField2, "debug f2",float,"%.4f"
; Alternator_PID: previous error
; DBG_TPS_ACCEL: tps<>tps table value ; DBG_TPS_ACCEL: tps<>tps table value
entry = debugFloatField3, "debug f3",float,"%.4f" entry = debugFloatField3, "debug f3",float,"%.4f"
; Alternator_PID: I setting
; DBG_TPS_ACCEL: extra fuel ; DBG_TPS_ACCEL: extra fuel
entry = debugFloatField4, "debug f4",float,"%.4f" entry = debugFloatField4, "debug f4",float,"%.4f"
; Alternator_PID: D setting
entry = debugFloatField5, "debug f5",float,"%.4f" entry = debugFloatField5, "debug f5",float,"%.4f"
; Alternator_PID: P setting
entry = debugIntField1, "debug i1",int,"%d" entry = debugIntField1, "debug i1",int,"%d"
; Alternator_PID: offset setting
entry = debugIntField2, "debug i2",int,"%d" entry = debugIntField2, "debug i2",int,"%d"
; Alternator_PID: PID reset counter
entry = debugIntField3, "debug i3",int,"%d" entry = debugIntField3, "debug i3",int,"%d"
entry = warningCounter, "warn",int,"%d" entry = warningCounter, "warn",int,"%d"
entry = lastErrorCode, "error",int,"%d" entry = lastErrorCode, "error",int,"%d"