doppelhub / MuddersMIMA

Mudders Take on Manual IMA Control in the G1 Honda Insight
GNU General Public License v3.0
2 stars 4 forks source link

[WIP] feat: mode1: Blend in a new map for IMA power based on TPS+VSS+BRAKE #9

Open Hurricos opened 8 months ago

Hurricos commented 8 months ago

With this commit, blend a mapped "suggested" CMDPWR value based on the vehicle speed and TPS into the actual CMDPWR in LiControl mode 1.

The mapping is constructed so as to promote the use of IMA power at low throttle. This reduces the fatigue of using the IMA joystick, essentially allows regen to occur (for driving comfort) as soon as driving begins, and (for the CVT specifically) generates a driving habit which links IMA torque to engine torque, sparing the CVT from miscalculating total torque.

Work-in-progress, as it probably needs to be gated behind TRANSMISSION_IS_CVT.

Also, I need to find out why brake detection isn't working consistently.

Notes

This also requires the vehicle-speed PR, as we rely on knowing the vehicle speed in order to feed the map.

Hurricos commented 8 months ago

48dea11 -> c1c56df cleaned up some whitespace issues.

Hurricos commented 8 months ago

c1c56df -> b90c773 renamed map_suggestedCMDPWR_VS_TPS to map_suggestedCMDPWR_TPS_VSS.

Note that the top commit of this PR increases:

RAM: +90B ROM: +552B

The ROM increase is primarily due to the size of 2d_map.cpp, but each uint8_t of each of map_TPS, map_VSS, map_suggestedCMDPWR_TPS_VSS takes up 2B of RAM and ROM. Believe it's possible to move these to PROGMEM to avoid the RAM side.

Hurricos commented 7 months ago

Corrections needed in order of concern: