Short term:
- Reduce throttle availability in cruise mode. The default in the param_prj.h is 50%, on something like an SDU that is way too much. You need just enough to maintain cruise at the speeds, and on the gradients, you are likely to encounter. 10-20% would be more like it. If people find cruise is underpowered they will increase it but if it just works they are likely to just run with defaults so the defaults should be sensible for all cases. In no case should cruise be allowed enough throttle authority to come anywhere near over riding the brakes on the driven axle (particularly relevant for RWD cars which tend to have weaker brakes on the driven axle)!
- Fix the bug in the scheduler that allows events to be missed. It's unlikely to be the problem here but it is still a bug.
- Make going into neutral, or a change in direction, cancel cruise. Again it's not a fix but it adds options if the problem occurs again and more importantly it adds a degree of redundancy on a potentially safety critical function that otherwise doesn't have any.
Longer term:
- Implement, and encourage, logging or some other way of collecting data (I really don't care what it is but you need the data!). Without it you will end up back in exactly the same position in another 6months. Agree completely with comments on root cause but without data your chance of finding it is low! That's why the simulator was able to find and fix issues, it generated the data, the data generated the understanding and the understanding provided the fixes.
- Review the code (I intend to restructure the way the scheduler and CAN threads work on my port as I'm not happy with the way it is at the moment, if this turns anything else up I'll post it here).