As-is, if I want to move between modes which are commanding a different CMDPWR value, the change of CMDPWR values generates a jerk which I want to avoid (think moving from mode 2 to 1 while holding the joystick).
To-be, when switching between modes, CMDPWR changes are "ramped" over a timeout (let's say 250ms).
Proposed logic:
The current mode, emitted CMDPWR, and last checked time are stored when checking the mode.
When checking the current mode, it is compared to the old mode, and changes are detected.
If the mode is the same as last cycle, reset the last checked time.
If the mode has changed, store the emitted CMDPWR from last cycle.
In all modes, calculate CMDPWR to-be emitted by taking a weighted average of CMDPWR requested and CMDPWR at last change, over the timeout duration.
This helps avoid jerk when switching 2->1->0, for example.
Reasons not to implement this:
Increases complexity of calculations of CMDPWR sent to MCM.
For example, 60S will need a 'minimum CMDPWR value' when assisting at high RPMs to avoid bucking due to the MCM closed-loop control being unable to compensate for slow IGBT switching time at highest voltages. Combining that safety-level minimum with the comfort-level ramping will be difficult.
As-is, if I want to move between modes which are commanding a different CMDPWR value, the change of CMDPWR values generates a jerk which I want to avoid (think moving from mode 2 to 1 while holding the joystick).
To-be, when switching between modes, CMDPWR changes are "ramped" over a timeout (let's say 250ms).
Proposed logic:
Reasons not to implement this: