Add rpm based dwell (as well as data for voltage based dwell)

This commit is contained in:
Steve Howes
2018-09-14 20:39:35 +01:00
parent b19b2c1823
commit 8c08af2458
2 changed files with 13 additions and 4 deletions
+2 -2
View File
@@ -72,11 +72,11 @@ void cas_process()
if((cylinder_next_fire == 1) || (cylinder_next_fire == 4))
{
task_coil1_fire = micros() + (usec_per_degree * (180 + ignition_offset - table_ignition[rpm_current_index + (map_current_index << 4)]));
task_coil1_charge = task_coil1_fire - (coil_dwell + table_dwell[battery_voltage_index]);
task_coil1_charge = task_coil1_fire - (coil_dwell + table_dwell_voltage[battery_voltage_index] + table_dwell_rpm[rpm_current_index]);
}else if((cylinder_next_fire == 2) || (cylinder_next_fire == 3))
{
task_coil2_fire = micros() + (usec_per_degree * (180 + ignition_offset - table_ignition[rpm_current_index + (map_current_index << 4)]));
task_coil2_charge = task_coil2_fire - (coil_dwell + table_dwell[battery_voltage_index]);
task_coil2_charge = task_coil2_fire - (coil_dwell + table_dwell_voltage[battery_voltage_index] + table_dwell_rpm[rpm_current_index]);
}
}
}
+11 -2
View File
@@ -47,9 +47,18 @@ byte table_ignition[] = {
// X = Voltage 7-16
// Index = [battery_voltage_index]
// Value = additional dwell in usec
const int table_dwell[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
const int table_dwell_voltage[] = {
2000, 2000, 2000, 2000, 1000, 0, 0, 0, 0, 0
};
// X = RPM 0 - 7200
// Index = [rpm_current_index]
// Value = additional dwell in usec
const int table_dwell_rpm[] = {
3000, 2000, 2000, 1000, 0, 0, 0, 0, 0, 0, 0, -1000, -1000, -1000, -2000, -2000,
};