After doing a lot of testing trying to figure out what exactly was causing roughness during transition from sensored to sensorless mode, I noticed that currents were not smooth in sensored mode and especially bad during sensorless transition.
There is a clear indication of deadtime distortion happening during transition to sensorless and, in fact, most of the time while running in sensored mode. Motor phase graph was showing bumps and troughs as well. As shown on the pictures below. Once past the transition, the currents and phase line become smooth.
Naturally, I started playing with the deadtime distortion value. It seems like increasing this value helped quite a bit to ease the roughness but I had to bump it to a value just below the point where the motor starts to "misfire" (cogs really violently, due to distortion compensation set too high). So, it had to be very carefully tuned between the least rough transition and the misfire points to find the speet spot.
Another interesting thing I noticed was that the higher I set HW_DEAD_TIME_NSEC in the firmware, the more rough transition was with the default compensation value of 0.12, so I had to bump it up really high to as much as 0.5 to reduce the roughness. However, if I dropped HW_DEAD_TIME_NSEC to ridiculously small values like 260, the transition was smoother and I had to raise the compensation value only to 0.2 or so.
I tested it all on my hardware which uses pretty fast drivers (19ns propagation delay, 100ns HW set minimum deadtime) together with mosfets 90ns (four in one group),12.2mOhm ON gate resistance and 4.4 total OFF resistance. I also checked for this issue on Trampa MK III which uses smaller gate resistance, and the distortion problem is there as well.
Conclusions so far:
1. The sensored mode does not really provide smooth commutation: phase line is never smooth and current show signs of deadtime distortion. The problem gets worse at around transition eRPM. Once past transition, phase and currents look perfect and the motor runs smooth.
2. The deadtime distortion compensation helps to reduce roughness during transition but doesn't completely eliminates it. Running sensorless mode even at very low eRPMs (below 1000) produces clean phase and currents graphs. It feels like sensored mode is just not working well at any eRPM.
Anyone experienced the same and/or have any deeper insights how to best address this issue?
Here is the graph showing what happens during transition. Phase gets pretty choppy and currents show spikes at specific spots pointing to deadtime distortion.
If not cured with deadtime compensation, things can get as bad as this during transition:
Even before the transition, running sensored mode, the phase and currents are bumpy:
Once past the transition or when running sensorless, all looks perfect: