It reports e.g.: "Latest injected ADC duration: 0.0253 ms".
FOC 20kHz PWM, and sampling in vectors V0 and V7, means interrupts come at 40kHz, right?
40*0.0253 > 1
Does that mean interrupt overload/overrun and that I should reduce PWM freq? How to detect overload?
By the way: RT-app works only sometimes... can that be related to MCU overload?
Maybe there are different definitions of FOC PWM frequency and PWM period?
I had expected something like Freq = 1/T, where T=PWM period as shown in fig 6 page 5: https://www.eal.ei.tum.de/fileadmin/tueieal/www/courses/PE/tutorial/2013...
When connecting an oscilloscope between GND and a motor terminal, then I would expect to see the PWM frequency, not PWM/2.
The point of svm is that you effectively double the switching frequency that the motor sees for a given amount of switching. Running three independent "normal" modulated channels at 20 kHz will give the same current ripple that the motor sees when running svm with a center aligned timer base frequency of 10 kHz. The timer will cycle through all vectors both when upcoming and when downcounting.
You can have a look around 32:20 in this video to see roughly how it works:
Thank you for explaining. I know SVM and I agree with what you say in your video, but note that your definition of SVM frequency deviates, by a factor 2, from (all?) textbooks. I made a similar simulation model in another millennium. The "effectively double" frequency is valid when modulation index is low, but I think the doubling can also be absent -- for example: consider the voltage between two motor terminals when modulation index is high and output voltage vector is middle between two of the primary vectors.
Result at mod index = 1 (almost same at 0.95, max used in VESC?):
This example is probably not relevant for your capacitor calc, but it might be relevant for audible noise.