Are you even aware of how abrasive and obnoxious/arrogant you come off as? Having met and known Ben and also having read your thesis and seen your code it’s pretty clear to me who is someone revolutionizing open-source code for motor control and who is busy strutting around like a know-it-all trying to show off how much CS classes they took. In general I try to be a positive guy but nobody should get a free pass to act like as much of a prick as you have been toward a guy that out-classes you so far in character and intelligence. You look pathetic trying to pretend you are at the same level as him because you wrote some derivative BLDC algorithm that you pretend is some revolution when its actually just regurgitated ideas from the 1900s.
Sorting 9 items in a list at 1 kHz in a low priority thread is pretty damn cheap relative to the rest of the code. It’s always nice to optimize but it also takes time and won’t make any observable difference to the performance of the controller, in that way it is a pretty stupid way to waste time so should be a perfect task for you. I can see you seem to enjoy wasting time trying to slam a guy that has never wronged you in any way.
The motor temp problem stems mostly from the fact that not everyone is running the same analog LPF on the motor temp sense and the lack of control on routing of the sense wires in the motor. I think a lot of the hardware has higher cutoff frequency around 100 hz which means noise passes through up to 1kHz. The vesc 6 LPF definitely makes this issue less prevalent. If you want to know why noise is coupled into the motors temp sense all you have to do is look inside a motor to find all the terrible coupling you need:
We’ll continue trying to improve the code to get reliable performance but there is only so far digital filtering can go when aliased samples are taken. On the stormcore we ended up swapping the cutoff freq of the LPF to address this but there isn’t much I can do for all the people using unity’s out there, except to say get a motor with better temp-sense routing.