auto-sync

This commit is contained in:
rusEfi 2015-12-26 23:03:07 -05:00
parent 5fa5f6ce0b
commit f6fa5f945a
3 changed files with 35 additions and 23 deletions

View File

@ -114,23 +114,23 @@ static float dodge_map_advance_table[16][16] = {
};
static const fuel_table_t veDefaultTable = {
/* Generated by TS2C on Fri Jun 12 20:12:10 EDT 2015*/
{/* 0 0.000 *//* 0 800.0*/65.000, /* 1 1213.3281*/65.000, /* 2 1626.6562*/71.583, /* 3 2040.0*/81.958, /* 4 2453.3438*/72.681, /* 5 2866.6562*/63.117, /* 6 3280.0*/80.958, /* 7 3693.3438*/92.231, /* 8 4106.6875*/84.994, /* 9 4520.0*/79.394, /* 10 4933.3125*/84.473, /* 11 5346.6875*/79.501, /* 12 5760.0*/66.256, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000 },
{/* 1 6.660 *//* 0 800.0*/65.000, /* 1 1213.3281*/68.319, /* 2 1626.6562*/70.066, /* 3 2040.0*/76.505, /* 4 2453.3438*/70.682, /* 5 2866.6562*/61.771, /* 6 3280.0*/69.354, /* 7 3693.3438*/76.628, /* 8 4106.6875*/74.881, /* 9 4520.0*/69.985, /* 10 4933.3125*/67.129, /* 11 5346.6875*/65.000, /* 12 5760.0*/63.548, /* 13 6173.3125*/64.151, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000 },
{/* 2 13.330 *//* 0 800.0*/63.337, /* 1 1213.3281*/63.141, /* 2 1626.6562*/62.413, /* 3 2040.0*/67.463, /* 4 2453.3438*/67.996, /* 5 2866.6562*/64.892, /* 6 3280.0*/73.735, /* 7 3693.3438*/71.103, /* 8 4106.6875*/70.928, /* 9 4520.0*/69.645, /* 10 4933.3125*/66.696, /* 11 5346.6875*/65.000, /* 12 5760.0*/65.000, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 3 20.000 *//* 0 800.0*/64.981, /* 1 1213.3281*/62.534, /* 2 1626.6562*/64.200, /* 3 2040.0*/64.263, /* 4 2453.3438*/67.188, /* 5 2866.6562*/65.203, /* 6 3280.0*/74.144, /* 7 3693.3438*/68.697, /* 8 4106.6875*/67.542, /* 9 4520.0*/64.122, /* 10 4933.3125*/65.000, /* 11 5346.6875*/65.000, /* 12 5760.0*/65.000, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 4 26.660 *//* 0 800.0*/79.456, /* 1 1213.3281*/68.161, /* 2 1626.6562*/65.749, /* 3 2040.0*/65.897, /* 4 2453.3438*/65.729, /* 5 2866.6562*/63.020, /* 6 3280.0*/70.429, /* 7 3693.3438*/68.337, /* 8 4106.6875*/65.632, /* 9 4520.0*/66.161, /* 10 4933.3125*/65.884, /* 11 5346.6875*/65.000, /* 12 5760.0*/65.000, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 5 33.330 *//* 0 800.0*/73.806, /* 1 1213.3281*/69.843, /* 2 1626.6562*/68.664, /* 3 2040.0*/67.639, /* 4 2453.3438*/65.939, /* 5 2866.6562*/64.313, /* 6 3280.0*/67.534, /* 7 3693.3438*/67.136, /* 8 4106.6875*/66.067, /* 9 4520.0*/65.000, /* 10 4933.3125*/67.173, /* 11 5346.6875*/67.919, /* 12 5760.0*/65.000, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 6 40.000 *//* 0 800.0*/75.770, /* 1 1213.3281*/75.383, /* 2 1626.6562*/67.496, /* 3 2040.0*/64.699, /* 4 2453.3438*/66.258, /* 5 2866.6562*/65.045, /* 6 3280.0*/67.375, /* 7 3693.3438*/66.887, /* 8 4106.6875*/67.638, /* 9 4520.0*/65.950, /* 10 4933.3125*/67.792, /* 11 5346.6875*/67.666, /* 12 5760.0*/65.000, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 7 46.660 *//* 0 800.0*/75.436, /* 1 1213.3281*/74.563, /* 2 1626.6562*/69.240, /* 3 2040.0*/65.546, /* 4 2453.3438*/67.013, /* 5 2866.6562*/65.683, /* 6 3280.0*/66.192, /* 7 3693.3438*/67.664, /* 8 4106.6875*/69.391, /* 9 4520.0*/67.002, /* 10 4933.3125*/68.592, /* 11 5346.6875*/66.540, /* 12 5760.0*/65.729, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 8 53.330 *//* 0 800.0*/74.583, /* 1 1213.3281*/73.537, /* 2 1626.6562*/68.734, /* 3 2040.0*/67.995, /* 4 2453.3438*/69.053, /* 5 2866.6562*/66.242, /* 6 3280.0*/67.313, /* 7 3693.3438*/70.623, /* 8 4106.6875*/71.299, /* 9 4520.0*/70.246, /* 10 4933.3125*/69.689, /* 11 5346.6875*/66.708, /* 12 5760.0*/65.529, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 9 60.000 *//* 0 800.0*/68.523, /* 1 1213.3281*/71.390, /* 2 1626.6562*/66.799, /* 3 2040.0*/68.182, /* 4 2453.3438*/71.106, /* 5 2866.6562*/68.484, /* 6 3280.0*/66.322, /* 7 3693.3438*/69.185, /* 8 4106.6875*/70.371, /* 9 4520.0*/69.260, /* 10 4933.3125*/68.101, /* 11 5346.6875*/67.820, /* 12 5760.0*/64.426, /* 13 6173.3125*/62.572, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 10 66.660 *//* 0 800.0*/65.000, /* 1 1213.3281*/65.000, /* 2 1626.6562*/65.000, /* 3 2040.0*/65.000, /* 4 2453.3438*/65.000, /* 5 2866.6562*/65.000, /* 6 3280.0*/65.000, /* 7 3693.3438*/65.588, /* 8 4106.6875*/65.533, /* 9 4520.0*/65.000, /* 10 4933.3125*/64.054, /* 11 5346.6875*/65.000, /* 12 5760.0*/65.000, /* 13 6173.3125*/64.423, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 11 73.330 *//* 0 800.0*/65.000, /* 1 1213.3281*/65.000, /* 2 1626.6562*/65.000, /* 3 2040.0*/65.000, /* 4 2453.3438*/65.000, /* 5 2866.6562*/65.000, /* 6 3280.0*/65.000, /* 7 3693.3438*/65.000, /* 8 4106.6875*/65.000, /* 9 4520.0*/65.000, /* 10 4933.3125*/65.000, /* 11 5346.6875*/65.000, /* 12 5760.0*/65.000, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 12 80.000 *//* 0 800.0*/65.000, /* 1 1213.3281*/65.000, /* 2 1626.6562*/65.000, /* 3 2040.0*/65.000, /* 4 2453.3438*/65.000, /* 5 2866.6562*/65.000, /* 6 3280.0*/65.000, /* 7 3693.3438*/65.000, /* 8 4106.6875*/65.000, /* 9 4520.0*/65.000, /* 10 4933.3125*/65.000, /* 11 5346.6875*/65.000, /* 12 5760.0*/65.000, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 13 86.660 *//* 0 800.0*/65.000, /* 1 1213.3281*/65.000, /* 2 1626.6562*/65.000, /* 3 2040.0*/65.000, /* 4 2453.3438*/65.000, /* 5 2866.6562*/65.000, /* 6 3280.0*/65.000, /* 7 3693.3438*/65.000, /* 8 4106.6875*/65.000, /* 9 4520.0*/65.000, /* 10 4933.3125*/65.000, /* 11 5346.6875*/65.000, /* 12 5760.0*/65.000, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 14 93.330 *//* 0 800.0*/65.000, /* 1 1213.3281*/65.000, /* 2 1626.6562*/65.000, /* 3 2040.0*/65.000, /* 4 2453.3438*/65.000, /* 5 2866.6562*/65.000, /* 6 3280.0*/65.000, /* 7 3693.3438*/65.000, /* 8 4106.6875*/65.000, /* 9 4520.0*/65.000, /* 10 4933.3125*/65.000, /* 11 5346.6875*/65.000, /* 12 5760.0*/65.000, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, },
{/* 15 100.000 *//* 0 800.0*/65.000, /* 1 1213.3281*/65.000, /* 2 1626.6562*/65.000, /* 3 2040.0*/65.000, /* 4 2453.3438*/65.000, /* 5 2866.6562*/65.000, /* 6 3280.0*/65.000, /* 7 3693.3438*/65.000, /* 8 4106.6875*/65.000, /* 9 4520.0*/65.000, /* 10 4933.3125*/65.000, /* 11 5346.6875*/65.000, /* 12 5760.0*/65.000, /* 13 6173.3125*/65.000, /* 14 6586.6875*/65.000, /* 15 7000.0*/65.000, }
/* Generated by TS2C on Sat Dec 26 22:43:00 EST 2015*/
{/* 0 10.000 *//* 0 800.0*/77.705, /* 1 1213.0*/79.677, /* 2 1626.0*/138.455, /* 3 2040.0*/200.727, /* 4 2453.0*/212.709, /* 5 2866.0*/183.096, /* 6 3280.0*/186.959, /* 7 3693.0*/195.666, /* 8 4106.0*/173.553, /* 9 4520.0*/122.331, /* 10 4933.0*/110.157, /* 11 5346.0*/102.938, /* 12 5760.0*/92.029, /* 13 6173.0*/81.913, /* 14 6586.0*/76.487, /* 15 7000.0*/68.971, },
{/* 1 20.000 *//* 0 800.0*/78.503, /* 1 1213.0*/78.792, /* 2 1626.0*/85.287, /* 3 2040.0*/92.587, /* 4 2453.0*/91.010, /* 5 2866.0*/80.823, /* 6 3280.0*/91.492, /* 7 3693.0*/102.411, /* 8 4106.0*/104.244, /* 9 4520.0*/88.303, /* 10 4933.0*/93.040, /* 11 5346.0*/97.170, /* 12 5760.0*/96.855, /* 13 6173.0*/82.471, /* 14 6586.0*/71.803, /* 15 7000.0*/65.000, },
{/* 2 30.000 *//* 0 800.0*/73.538, /* 1 1213.0*/71.274, /* 2 1626.0*/70.557, /* 3 2040.0*/80.186, /* 4 2453.0*/84.024, /* 5 2866.0*/79.550, /* 6 3280.0*/89.762, /* 7 3693.0*/90.313, /* 8 4106.0*/93.888, /* 9 4520.0*/87.804, /* 10 4933.0*/83.923, /* 11 5346.0*/78.449, /* 12 5760.0*/83.166, /* 13 6173.0*/78.263, /* 14 6586.0*/69.142, /* 15 7000.0*/65.000, },
{/* 3 40.000 *//* 0 800.0*/55.967, /* 1 1213.0*/67.774, /* 2 1626.0*/71.198, /* 3 2040.0*/74.200, /* 4 2453.0*/77.684, /* 5 2866.0*/73.409, /* 6 3280.0*/83.968, /* 7 3693.0*/84.921, /* 8 4106.0*/82.933, /* 9 4520.0*/74.173, /* 10 4933.0*/67.813, /* 11 5346.0*/70.056, /* 12 5760.0*/74.011, /* 13 6173.0*/70.667, /* 14 6586.0*/66.251, /* 15 7000.0*/67.962, },
{/* 4 50.000 *//* 0 800.0*/67.990, /* 1 1213.0*/64.226, /* 2 1626.0*/70.278, /* 3 2040.0*/72.016, /* 4 2453.0*/73.000, /* 5 2866.0*/66.698, /* 6 3280.0*/74.353, /* 7 3693.0*/78.986, /* 8 4106.0*/81.496, /* 9 4520.0*/71.259, /* 10 4933.0*/70.155, /* 11 5346.0*/67.916, /* 12 5760.0*/66.127, /* 13 6173.0*/66.196, /* 14 6586.0*/65.000, /* 15 7000.0*/65.000, },
{/* 5 60.000 *//* 0 800.0*/64.467, /* 1 1213.0*/60.786, /* 2 1626.0*/68.500, /* 3 2040.0*/70.726, /* 4 2453.0*/71.772, /* 5 2866.0*/66.932, /* 6 3280.0*/67.696, /* 7 3693.0*/73.407, /* 8 4106.0*/74.618, /* 9 4520.0*/67.430, /* 10 4933.0*/67.173, /* 11 5346.0*/67.919, /* 12 5760.0*/66.483, /* 13 6173.0*/67.374, /* 14 6586.0*/65.000, /* 15 7000.0*/65.000, },
{/* 6 70.000 *//* 0 800.0*/70.325, /* 1 1213.0*/63.583, /* 2 1626.0*/65.404, /* 3 2040.0*/65.775, /* 4 2453.0*/68.912, /* 5 2866.0*/67.830, /* 6 3280.0*/69.091, /* 7 3693.0*/75.404, /* 8 4106.0*/75.790, /* 9 4520.0*/66.988, /* 10 4933.0*/67.792, /* 11 5346.0*/70.051, /* 12 5760.0*/67.297, /* 13 6173.0*/65.000, /* 14 6586.0*/65.000, /* 15 7000.0*/65.000, },
{/* 7 80.000 *//* 0 800.0*/75.436, /* 1 1213.0*/69.743, /* 2 1626.0*/63.091, /* 3 2040.0*/64.408, /* 4 2453.0*/67.013, /* 5 2866.0*/65.683, /* 6 3280.0*/66.245, /* 7 3693.0*/67.493, /* 8 4106.0*/75.594, /* 9 4520.0*/67.002, /* 10 4933.0*/68.592, /* 11 5346.0*/68.600, /* 12 5760.0*/67.357, /* 13 6173.0*/65.000, /* 14 6586.0*/65.000, /* 15 7000.0*/66.579, },
{/* 8 90.000 *//* 0 800.0*/74.583, /* 1 1213.0*/67.213, /* 2 1626.0*/66.079, /* 3 2040.0*/66.933, /* 4 2453.0*/70.067, /* 5 2866.0*/71.642, /* 6 3280.0*/75.148, /* 7 3693.0*/78.010, /* 8 4106.0*/76.340, /* 9 4520.0*/72.307, /* 10 4933.0*/71.328, /* 11 5346.0*/68.254, /* 12 5760.0*/65.529, /* 13 6173.0*/65.000, /* 14 6586.0*/65.000, /* 15 7000.0*/67.042, },
{/* 9 100.000 *//* 0 800.0*/68.523, /* 1 1213.0*/70.304, /* 2 1626.0*/65.384, /* 3 2040.0*/65.440, /* 4 2453.0*/71.943, /* 5 2866.0*/72.775, /* 6 3280.0*/74.204, /* 7 3693.0*/76.186, /* 8 4106.0*/71.162, /* 9 4520.0*/69.260, /* 10 4933.0*/67.498, /* 11 5346.0*/68.341, /* 12 5760.0*/66.665, /* 13 6173.0*/63.622, /* 14 6586.0*/63.708, /* 15 7000.0*/63.597, },
{/* 10 110.000 *//* 0 800.0*/65.000, /* 1 1213.0*/65.000, /* 2 1626.0*/65.000, /* 3 2040.0*/65.000, /* 4 2453.0*/65.000, /* 5 2866.0*/65.000, /* 6 3280.0*/65.000, /* 7 3693.0*/65.588, /* 8 4106.0*/65.533, /* 9 4520.0*/65.000, /* 10 4933.0*/64.054, /* 11 5346.0*/65.000, /* 12 5760.0*/65.000, /* 13 6173.0*/64.423, /* 14 6586.0*/65.000, /* 15 7000.0*/65.000, },
{/* 11 120.000 *//* 0 800.0*/65.000, /* 1 1213.0*/65.000, /* 2 1626.0*/65.000, /* 3 2040.0*/65.000, /* 4 2453.0*/65.000, /* 5 2866.0*/65.000, /* 6 3280.0*/65.000, /* 7 3693.0*/65.000, /* 8 4106.0*/65.000, /* 9 4520.0*/65.000, /* 10 4933.0*/65.000, /* 11 5346.0*/65.000, /* 12 5760.0*/65.000, /* 13 6173.0*/65.000, /* 14 6586.0*/65.000, /* 15 7000.0*/65.000, },
{/* 12 130.000 *//* 0 800.0*/65.000, /* 1 1213.0*/65.000, /* 2 1626.0*/65.000, /* 3 2040.0*/65.000, /* 4 2453.0*/65.000, /* 5 2866.0*/65.000, /* 6 3280.0*/65.000, /* 7 3693.0*/65.000, /* 8 4106.0*/65.000, /* 9 4520.0*/65.000, /* 10 4933.0*/65.000, /* 11 5346.0*/65.000, /* 12 5760.0*/65.000, /* 13 6173.0*/65.000, /* 14 6586.0*/65.000, /* 15 7000.0*/65.000, },
{/* 13 140.000 *//* 0 800.0*/65.000, /* 1 1213.0*/65.000, /* 2 1626.0*/65.000, /* 3 2040.0*/65.000, /* 4 2453.0*/65.000, /* 5 2866.0*/65.000, /* 6 3280.0*/65.000, /* 7 3693.0*/65.000, /* 8 4106.0*/65.000, /* 9 4520.0*/65.000, /* 10 4933.0*/65.000, /* 11 5346.0*/65.000, /* 12 5760.0*/65.000, /* 13 6173.0*/65.000, /* 14 6586.0*/65.000, /* 15 7000.0*/65.000, },
{/* 14 150.000 *//* 0 800.0*/65.000, /* 1 1213.0*/65.000, /* 2 1626.0*/65.000, /* 3 2040.0*/65.000, /* 4 2453.0*/65.000, /* 5 2866.0*/65.000, /* 6 3280.0*/65.000, /* 7 3693.0*/65.000, /* 8 4106.0*/65.000, /* 9 4520.0*/65.000, /* 10 4933.0*/65.000, /* 11 5346.0*/65.000, /* 12 5760.0*/65.000, /* 13 6173.0*/65.000, /* 14 6586.0*/65.000, /* 15 7000.0*/65.000, },
{/* 15 160.000 *//* 0 800.0*/65.000, /* 1 1213.0*/65.000, /* 2 1626.0*/65.000, /* 3 2040.0*/65.000, /* 4 2453.0*/65.000, /* 5 2866.0*/65.000, /* 6 3280.0*/65.000, /* 7 3693.0*/65.000, /* 8 4106.0*/65.000, /* 9 4520.0*/65.000, /* 10 4933.0*/65.000, /* 11 5346.0*/65.000, /* 12 5760.0*/65.000, /* 13 6173.0*/65.000, /* 14 6586.0*/65.000, /* 15 7000.0*/65.000, },
};
@ -413,8 +413,8 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
boardConfiguration->vehicleSpeedSensorInputPin = GPIOA_8;
engineConfiguration->hasVehicleSpeedSensor = true;
engineConfiguration->fanOnTemperature = 85;
engineConfiguration->fanOffTemperature = 80;
engineConfiguration->fanOnTemperature = 92;
engineConfiguration->fanOffTemperature = 89;
// boardConfiguration->tunerStudioSerialSpeed = 9600;
boardConfiguration->tunerStudioSerialSpeed = 19200;

View File

@ -34,9 +34,21 @@ void configureNeon2003TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
s->tdcPosition = 496;
// are these non-default values really needed here now that the gap is finally precise?
s->setTriggerSynchronizationGap2(0.75, 1.40);
s->setSecondTriggerSynchronizationGap2(0.7, 1.25);
/**
* ratio sequence is:
gap=2.17/1.46
gap=0.33/2.17
gap=1.06/0.33
gap=2.73/1.06
gap=0.47/2.73
gap=0.71/0.47
gap=1.43/0.71
*
*/
// these values only work well for 'useFronOnly' mode!!!
s->setTriggerSynchronizationGap2(0.75, 1.5);
s->setSecondTriggerSynchronizationGap2(0.65, 1.25);
float EPS_ANGLE = 0.3;

View File

@ -211,7 +211,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
float gap = 1.0 * currentDuration / toothed_previous_duration;
float prevGap = 1.0 * toothed_previous_duration / durationBeforePrevious;
#if EFI_PROD_CODE || defined(__DOXYGEN__)
scheduleMsg(logger, "gap=%f/%f @ %d while expected %f/%f and %f/%f", gap, prevGap, currentCycle.current_index, TRIGGER_SHAPE(syncRatioFrom), TRIGGER_SHAPE(syncRatioTo), TRIGGER_SHAPE(secondSyncRatioFrom), TRIGGER_SHAPE(secondSyncRatioTo));
scheduleMsg(logger, "gap=%f/%f @ %d while expected %f/%f and %f/%f error=%d", gap, prevGap, currentCycle.current_index, TRIGGER_SHAPE(syncRatioFrom), TRIGGER_SHAPE(syncRatioTo), TRIGGER_SHAPE(secondSyncRatioFrom), TRIGGER_SHAPE(secondSyncRatioTo), someSortOfTriggerError);
#else
actualSynchGap = gap;
print("current gap %f/%f c=%d prev=%d\r\n", gap, prevGap, currentDuration, toothed_previous_duration);