launch control for autocross on micro rusefi #4341

This commit is contained in:
rusefillc 2022-07-14 17:23:54 -04:00
parent e4f210c1ca
commit 26fba94d07
1 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,9 @@
-- analog knob controls desired launch RPM and boost
desiredRpmCurve = findCurveIndex("desired_rpm")
desiredBoostCurve = findCurveIndex("desired_boost")
-- we lookup initial torque reduction based on desired RPM and boost
initialTorqueReductionTable = findTableIndex("torque_red")
-- we have tables for spark skip ratio and spark retard based on desired torque reduction
sparkCutByTorqueCurve = findCurveIndex("spark_cut")
sparkRetardByTorqueCurve = findCurveIndex("spark_retard")
@ -9,6 +12,7 @@ previousLaunchButtonState = 0
-- 50Hz
setTickRate(50)
-- we PID torque reduction TODO hard code better PID settings?
-- p, i, d, min, max
pid = Pid.new(2, 0, 0, -100, 100)