Myself, @vadicus, @bgdwiepp, and @TechAUmNu have discussed some common observations on our hardware when using the VESC firmware. We observed several factors that affect the quality of motor detection and motor operation for FOC. I will do my best to summarize our findings here.
1. L detection is and miss with HFI detection method. You make five measurement and then maybe choose the one with the most hits. The previous method was using a lot more current so it was at least consistent/predictable. Parasitic inductances in 3rd party hardware may be more significant than in original VESC hardware especially if using traditional leaded MOSFETs. Using high current for measuring L & R could help saturate these parasitic inductance. Proposed solution is to either allow for adjustable current for L measurements or allow the option of using the old measurement process.
2. The R and L, and even lambda detection values are varying with voltage and therefore switching rise/fall times. L is most affected, R and L can change insignificantly but do change. It may be because there was no consideration of operation above 80v. Proposed solution is to add a logic to track the supply voltage and adjust the test result accordingly.
3. Current filters. I(vadicus,) found no significant difference changing current sensor filters within 10-300khz cutoff range. It seems like hall sensors behave way differently (slower, less accurate) compared to resistance shunt. My resolution is pretty low, at around 2mv/A to allow up to 700A measurement. It generally works at above 10A where the current signal is stable. However, at around 0-3A or so there is a lot of jitter that makes things like HFI not work correctly.
4. Power supply inductance can add to the error in readings if it isn't compensated for; if you are using an applied voltage - rise time method and your input voltage sags due to power supply inductance you can get incredibly poor results, even just using a linear ramp of input voltage for V0 and Vfinal to compensate can offer huge accuracy improvements.
5. Observer gain accuracy seems impact operation of large motors. Calculation of observer gain in older VESC Tool versions seem inaccurate but also seem to be gradually improved on with new VESC Tool versions. Unfortunately the VESC Tool versions with improved observer gain calculations also have the new L measurement process that is problematic.
So the factors involved here seem to be parasitic inductances in the power stage, MOSFET switching rise/fall times, supply voltage, current sense measurement type, and observer gain accuracy.
I invite @Paltatech, @DerelictRobot, @benjamin, and anyone else who would like to contribute their findings or discuss the issues at hand. Any advice here will help hardware developers understand what is going on and potentially discover improvements that could be made to the VESC project.