Hello, I'm happy to have found this excellent resource - thanks!
I'm particularly curious about the flux linkage observer, and how it can could be improved to get even better low-speed performance. The observer is implemented in observer_update in mcpwm_foc.c (e83af32) and appears (from the comments in the same file) to be based on a method by Hong et al. Reading the paper, the main strengths appear to be that the angle estimator does not involve the (estimated) angular velocity) and that it is straightforward to implement. The main weakness, also pointed out in the paper, is that observability is lost at zero angular velocity, which is obvious as there is no back-EMF at standstill (after possible transients have faded).
Here's a bunch of topics for discussion and possible implementation that came to mind:
1. Has anyone here tried/thought about improved angle estimation at low speeds? Perhaps using HF signal injection to retrieve observability?
2. The stator resistance changes with temperature and there seems to exist several techniques for estimating them online. Two possible reasons for doing this would be to use the online estimates as input to the thermal protection algorithm, and 2) improve performance of the flux linkage observer when the motor runs (or starts) hot.
3. The VESC code seems to (correct me if I am wrong!) assume that all three stator winding groups have constant and identical inductance and internal resistance. Looking quickly at the implementation and underlying models, I don't see a problem in identifying individual values La, Lb, Lc and Ra, Rb, Rc for the three stator winding groups, again with the intention to improve flux linkage estimation.
I have not yet made any simulations, and perhaps the "improvements" suggested in 2 and 3 are practically negligible. I'd be happy to hear your thoughts on this.