okay, as this is showing the low-rpm "oscillation" situation, you can be sure that it
is correlated to the electrical motor angle - simply because the shape of distortion from a sawtooth is similar in each cycle.
But I still don't really trust the encoder yet. At higher rpm under load, do you get a nice sawtooth? That would rule out possible problems there.
Current waveform Ia is good. If you look close at it, then you can see that it is not perfectly sinusodial. There are small flat sections around zero crossing. I have seen much worse, like this for example (googled) :
PWM also looks good, so I would say (unless the encoder has some problems) both electronics and firmware are in good shape.
I am slowly coming to the point that the BLDC's torque ripple together with the wheel's inertia leads to a situation that cannot be solved by a PI controller at low rpm. Put simple: the wheel inertia limits the Kp / Ki gains that you can allow to maintain stability. (You can try tuning the speed controller without the wheel, you should be able to use much higher gains!) The lower gains limit the controller's ability to compensate for the torque ripple.
If that turns out correct, I don't see simple options...
- use motor with higher pole count (mitigate problem by shifting it to even lower rpm)
- use motor with PMSM construction (eliminate torque ripple)
- use higher rpm motor and higher gear reduction ratio (this reduces the inertia that the motor "sees")
- I think that the speed controller has a feedforward option, that can help to improve stability, but don't expect too much from that