Closed Throttle position detection. How does it work?

Closed throttle detection is based on how close the current throttle position is to tpsLow. That is initially set to the Initial Minimum, and can decrease if a tps position is detected which is lower than the Initial Minimim, but tpsLow cannot fall below the Minimum Limit, even if the tps reads lower than the Minimim Limit; this prevents a temporary open circuit from re-setting the minimum to an un-achievable minimum. When the tps drops below the sum of tpsLow and the Window the throttle is considered closed. It must then rise up to tpsLow plus the Window plus the Hysteresis to be considered open again.

Allowing tpsLow to drop below the Initial Minimum means that the closed throttle detection is less dependant on getting the TPS linearisation perfect, and allows some drift during operation. If the throttle starts reading lower in operation, tpsLow can drop and move the closed throttle detection down (up to a limit, being the Minimum Limit). If it starts not reading as low then it still has to creep up by the window size before closed condition can no longer be detected.