auto-sync

This commit is contained in:
rusEfi 2016-10-11 21:03:00 -04:00
parent 065c8529c1
commit dbb8de8b55
11 changed files with 43 additions and 35 deletions

View File

@ -241,7 +241,7 @@ void handlePageSelectCommand(ts_channel_s *tsChannel, ts_response_format_e mode,
tsSendResponse(tsChannel, mode, NULL, 0);
}
static void onlineTuneBytes(int currentPageId, int offset, int count) {
static void onlineTuneBytes(int currentPageId, uint32_t offset, int count) {
if (offset > sizeof(engine_configuration_s)) {
int maxSize = sizeof(persistent_config_s) - offset;
if (count > maxSize) {

View File

@ -768,7 +768,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->clutchUpState = engine->clutchUpState;
tsOutputChannels->clutchDownState = engine->clutchDownState;
tsOutputChannels->tCharge = getTCharge(rpm, tps, coolant, intake);
tsOutputChannels->tCharge = getTCharge(rpm, tps, coolant, intake PASS_ENGINE_PARAMETER);
float timing = engine->engineState.timingAdvance;
tsOutputChannels->ignitionAdvance = timing > 360 ? timing - 720 : timing;
tsOutputChannels->sparkDwell = ENGINE(engineState.sparkDwell);

View File

@ -190,7 +190,7 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
float coolantC = ENGINE(engineState.clt);
float intakeC = ENGINE(engineState.iat);
float tps = getTPS(PASS_ENGINE_PARAMETER_F);
tChargeK = convertCelsiusToKelvin(getTCharge(rpm, tps, coolantC, intakeC));
tChargeK = convertCelsiusToKelvin(getTCharge(rpm, tps, coolantC, intakeC PASS_ENGINE_PARAMETER));
float map = getMap();
/**

View File

@ -1,4 +1,4 @@
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Oct 02 13:12:05 EDT 2016
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Oct 11 20:15:08 EDT 2016
// begin
#ifndef ENGINE_CONFIGURATION_GENERATED_H_
#define ENGINE_CONFIGURATION_GENERATED_H_
@ -1798,7 +1798,7 @@ typedef struct {
*/
float crankingCycleBins[CRANKING_CURVE_SIZE];
/**
* CLT-based adjustment for simple manual idle controller
* CLT-based idle position multiplier for simple manual idle controller
* offset 7032
*/
float cltIdleCorrBins[CLT_CURVE_SIZE];
@ -1959,4 +1959,4 @@ typedef struct {
#endif
// end
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Oct 02 13:12:05 EDT 2016
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Oct 11 20:15:08 EDT 2016

View File

@ -14,14 +14,11 @@
#include "engine_math.h"
#include "engine_state.h"
#define K_AT_MIN_RPM_MIN_TPS 0.25
#define K_AT_MIN_RPM_MAX_TPS 0.25
#define K_AT_MAX_RPM_MIN_TPS 0.25
#define K_AT_MAX_RPM_MAX_TPS 0.9
#define rpmMin 500
#define rpmMax 8000
EXTERN_ENGINE;
fuel_Map3D_t veMap("VE");
fuel_Map3D_t ve2Map("VE2");
afr_Map3D_t afrMap("AFR", 1.0 / AFR_STORAGE_MULT);
@ -30,11 +27,11 @@ baroCorr_Map3D_t baroCorrMap("baro");
#define tpMin 0
#define tpMax 100
// http://rusefi.com/math/t_charge.html
float getTCharge(int rpm, float tps, float coolantTemp, float airTemp) {
float minRpmKcurrentTPS = interpolate(tpMin, K_AT_MIN_RPM_MIN_TPS, tpMax,
K_AT_MIN_RPM_MAX_TPS, tps);
float maxRpmKcurrentTPS = interpolate(tpMin, K_AT_MAX_RPM_MIN_TPS, tpMax,
K_AT_MAX_RPM_MAX_TPS, tps);
float getTCharge(int rpm, float tps, float coolantTemp, float airTemp DECLARE_ENGINE_PARAMETER_S) {
float minRpmKcurrentTPS = interpolate(tpMin, engineConfiguration->tChargeMinRpmMinTps, tpMax,
engineConfiguration->tChargeMinRpmMaxTps, tps);
float maxRpmKcurrentTPS = interpolate(tpMin, engineConfiguration->tChargeMaxRpmMinTps, tpMax,
engineConfiguration->tChargeMaxRpmMaxTps, tps);
float Tcharge_coff = interpolate(rpmMin, minRpmKcurrentTPS, rpmMax, maxRpmKcurrentTPS, rpm);

View File

@ -9,7 +9,7 @@
#include "engine.h"
float getTCharge(int rpm, float tps, float coolantTemp, float airTemp);
float getTCharge(int rpm, float tps, float coolantTemp, float airTemp DECLARE_ENGINE_PARAMETER_S);
void setDetaultVETable(persistent_config_s *config);
float getAirMass(engine_configuration_s *engineConfiguration, float VE, float MAP, float tempK);
float sdMath(engine_configuration_s *engineConfiguration, float airMass, float AFR);

View File

@ -732,10 +732,10 @@ float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0.0, 300,
brain_input_pin_e camInput;
pid_dt[AUX_PID_COUNT iterate] auxPidDT;
float crankingIdleAdjustment;Extra idle while cranking;"percent", 1, 0, -100.0, 100,
float tChargeMinRpmMinTps;
float tChargeMinRpmMaxTps;
float tChargeMaxRpmMinTps;
float tChargeMaxRpmMaxTps;
float tChargeMinRpmMinTps;;"mult", 1, 0, 0, 3, 4
float tChargeMinRpmMaxTps;;"mult", 1, 0, 0, 3, 4
float tChargeMaxRpmMinTps;;"mult", 1, 0, 0, 3, 4
float tChargeMaxRpmMaxTps;;"mult", 1, 0, 0, 3, 4
brain_pin_e[AUX_PID_COUNT iterate] auxPidPins;
fsio_pwm_freq_t[AUX_PID_COUNT iterate] auxPidFrequency;
int alternatorPwmFrequency;;"Hz", 1, 0, 0, 3000.0, 0

View File

@ -294,5 +294,5 @@ int getRusEfiVersion(void) {
return 123; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE[0] * 0 != 0)
return 3211; // this is here to make the compiler happy about the unused array
return 20161010;
return 20161011;
}

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 Sat Oct 08 21:51:08 EDT 2016
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Oct 11 20:15:08 EDT 2016
pageSize = 16376
page = 1
@ -577,10 +577,10 @@ page = 1
auxPidDT3 = scalar, U32, 2420, "ms", 1, 0, 0, 3000, 0
auxPidDT4 = scalar, U32, 2424, "ms", 1, 0, 0, 3000, 0
crankingIdleAdjustment = scalar, F32, 2428, "percent", 1, 0, -100.0, 100,
;skipping tChargeMinRpmMinTps offset 2432
;skipping tChargeMinRpmMaxTps offset 2436
;skipping tChargeMaxRpmMinTps offset 2440
;skipping tChargeMaxRpmMaxTps offset 2444
tChargeMinRpmMinTps = scalar, F32, 2432, "mult", 1, 0, 0, 3, 4
tChargeMinRpmMaxTps = scalar, F32, 2436, "mult", 1, 0, 0, 3, 4
tChargeMaxRpmMinTps = scalar, F32, 2440, "mult", 1, 0, 0, 3, 4
tChargeMaxRpmMaxTps = scalar, F32, 2444, "mult", 1, 0, 0, 3, 4
auxPidPins1 = bits, U32, 2448, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
auxPidPins2 = bits, U32, 2452, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
auxPidPins3 = bits, U32, 2456, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
@ -1368,6 +1368,7 @@ fileVersion = { 20160702 }
subMenu = baroCorrTbl, "Baro Correction", 0, {fuelAlgorithm == 3}
subMenu = std_separator
subMenu = std_realtime, "&Realtime Display", 0
subMenu = tChargeSettings, "tCharge Settings"
menu = "3D Map Tuning"
; subMenu = std_realtime, "Realtime Display"
@ -1449,6 +1450,11 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01"
[UserDefined]
dialog = tChargeSettings, "tChart Settings"
field = "MinRpm MinTps", tChargeMinRpmMinTps
field = "MinRpm MaxTps", tChargeMinRpmMaxTps
field = "MaxRpm MinTps", tChargeMaxRpmMinTps
field = "MaxRpm MaxTps", tChargeMaxRpmMaxTps
dialog = baseInjection, "Injection"
field = "Enabled", isInjectionEnabled

View File

@ -1345,6 +1345,7 @@ fileVersion = { 20160702 }
subMenu = baroCorrTbl, "Baro Correction", 0, {fuelAlgorithm == 3}
subMenu = std_separator
subMenu = std_realtime, "&Realtime Display", 0
subMenu = tChargeSettings, "tCharge Settings"
menu = "3D Map Tuning"
; subMenu = std_realtime, "Realtime Display"
@ -1426,6 +1427,11 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01"
[UserDefined]
dialog = tChargeSettings, "tChart Settings"
field = "MinRpm MinTps", tChargeMinRpmMinTps
field = "MinRpm MaxTps", tChargeMinRpmMaxTps
field = "MaxRpm MinTps", tChargeMaxRpmMinTps
field = "MaxRpm MaxTps", tChargeMaxRpmMaxTps
dialog = baseInjection, "Injection"
field = "Enabled", isInjectionEnabled

View File

@ -30,8 +30,7 @@ void testEngineMath(void) {
printf("*************************************************** testEngineMath\r\n");
EngineTestHelper eth(FORD_ESCORT_GT);
Engine * engine = &eth.engine;
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
EXPAND_EngineTestHelper;
engineConfiguration->operationMode = FOUR_STROKE_CAM_SENSOR;
@ -39,14 +38,14 @@ void testEngineMath(void) {
assertEqualsM("6000 RPM", 5, getOneDegreeTimeMs(6000) * 180);
assertEquals(312.5, getTCharge(1000, 0, 300, 350));
assertEquals(313.5833, getTCharge(1000, 50, 300, 350));
assertEquals(314.6667, getTCharge(1000, 100, 300, 350));
assertEquals(312.5, getTCharge(1000, 0, 300, 350 PASS_ENGINE_PARAMETER));
assertEquals(313.5833, getTCharge(1000, 50, 300, 350 PASS_ENGINE_PARAMETER));
assertEquals(314.6667, getTCharge(1000, 100, 300, 350 PASS_ENGINE_PARAMETER));
assertEquals(312.5, getTCharge(4000, 0, 300, 350));
assertEquals(320.0833, getTCharge(4000, 50, 300, 350));
assertEquals(327.6667, getTCharge(4000, 100, 300, 350));
assertEquals(312.5, getTCharge(4000, 0, 300, 350 PASS_ENGINE_PARAMETER));
assertEquals(320.0833, getTCharge(4000, 50, 300, 350 PASS_ENGINE_PARAMETER));
assertEquals(327.6667, getTCharge(4000, 100, 300, 350 PASS_ENGINE_PARAMETER));
}
void testIgnitionMapGenerator(void) {