I was looking at the way we are limiting the current here (LimitCurrent method). As far as I understand, the LimitCurrent method is called at every PWM interrupt and uses the raw current values, not the RMS values. The software reads il1 and il2, calculates il3=-il1-il2, then finds IlMax = MAX(ABS(il1), ABS(il2), ABS(il3)). Then it starts limiting the current when the IlMax reaches 95% of iacmax (the code comment says 80%, maybe a mistake?). However, due to the nature of the sine wave, IlMax results in an "umbrella" shape, so are the Fslip limit and Ampnom limits.
In order to make sure, I recreated the LimitCurrent() method in Matlab and plotted some graph. Created three sinusoidal waves (50Hz) representing il1, il2 and il3, swinging from -400 to +400 amps, with 120 deg phase shift. I set iacmax to 400 and this is what I got (curlim.m file is attached):
Plot shows that the limit kicks in and out 5 times over one current period. So there is some point when running near iacmax where the torque starts rippling. I was wondering whether it would be better if we used this in the LimitCurrent():
Code: Select all
static s32fp LimitCurrent()
{
...
s32fp ilMax = ProcessCurrents();
s32fp rmsMax = MAX(Param::Get(Param::il1rms), Param::Get(Param::il2rms));
ilMax = MAX(ilMax, FP_MUL(rmsMax, FP_FROMFLT(1.4142)));
...
}
...
Or, am I just overrating the importance of the ripple here?