mirror of https://github.com/rusefi/rusefi.git
traction control ignition cut #5898
This commit is contained in:
parent
e159d0806d
commit
41669e0a52
|
@ -31,6 +31,8 @@
|
|||
// todo: reset this between cranking attempts?! #2735
|
||||
int minCrankingRpm = 0;
|
||||
|
||||
static Map3D<TRACTION_CONTROL_ETB_DROP_SIZE, TRACTION_CONTROL_ETB_DROP_SIZE, int8_t, uint16_t, uint8_t> tcTimingDropTable;
|
||||
|
||||
#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
|
||||
|
||||
/**
|
||||
|
@ -55,6 +57,12 @@ static angle_t getRunningAdvance(int rpm, float engineLoad) {
|
|||
config->ignitionRpmBins, rpm
|
||||
);
|
||||
|
||||
float vehicleSpeed = Sensor::getOrZero(SensorType::VehicleSpeed);
|
||||
float wheelSlip = Sensor::getOrZero(SensorType::WheelSlipRatio);
|
||||
engine->ignitionState.tractionAdvanceDrop = tcTimingDropTable.getValue(vehicleSpeed, wheelSlip);
|
||||
|
||||
advanceAngle += engine->ignitionState.tractionAdvanceDrop;
|
||||
|
||||
#if EFI_ANTILAG_SYSTEM
|
||||
if (engine->antilagController.isAntilagCondition) {
|
||||
float throttleIntent = Sensor::getOrZero(SensorType::DriverThrottleIntent);
|
||||
|
@ -247,4 +255,8 @@ size_t getMultiSparkCount(int rpm) {
|
|||
}
|
||||
}
|
||||
|
||||
void initIgnitionAdvanceControl() {
|
||||
tcTimingDropTable.init(engineConfiguration->tractionControlTimingDrop, engineConfiguration->tractionControlSpeedBins, engineConfiguration->tractionControlSlipBins);
|
||||
}
|
||||
|
||||
#endif // EFI_ENGINE_CONTROL
|
||||
|
|
|
@ -17,6 +17,7 @@ angle_t getCombinedCylinderIgnitionTrim(size_t cylinderNumber, int rpm, float ig
|
|||
float getInitialAdvance(int rpm, float map, float advanceMax);
|
||||
|
||||
size_t getMultiSparkCount(int rpm);
|
||||
void initIgnitionAdvanceControl();
|
||||
|
||||
class IgnitionState : public ignition_state_s {
|
||||
public:
|
||||
|
|
|
@ -506,6 +506,8 @@ void commonInitEngineController() {
|
|||
initLaunchControl();
|
||||
#endif
|
||||
|
||||
initIgnitionAdvanceControl();
|
||||
|
||||
#if EFI_UNIT_TEST
|
||||
engine->rpmCalculator.Register();
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
|
Loading…
Reference in New Issue