I didn’t want to work on sensorless because I think there are a lot of other lowest hanging fruits but Elwin reminded me yesterday how easy it is to implement the Flux observer from the MESC firmware I shared in June. David Molony got it implemented in VESC also together with Benjamin Vedder.
All the credit goes to David Molony, it might look complicated here but
apart from the mess I made in SimpleFOC to be able to use Alpha Beta Currents and Voltages, those are the few lines that are needed for the flux observer.
It’s incredibly simple but yet effective, and it’s using only current sensing…
This is not meant for 0 or low speed, velocity open loop could be used for the start up.
This paper is not related to this implementation but explains the formula used for the flux observer.
Here I am only calculating and displaying the angle in the main loop while running in velocity open loop, I am not using the angle for the commutation or anything else:
It needs phase_resistance and phase_inductance, and the flux_linkage that is used to saturate flux_a and flux_b, I calculated it based on the KV for a hoverboard motor but I am not 100% sure about the value.
Maybe you guys want to experiment with it on b-g431b-esc1 to see if it’s worth going further.