The reported frequency of a signal varies PWM frequency and sampling mode. Is this a bug?
How to reproduce:
- Connect motor, power, PC, start VESC Tool and tune FOC operation
- Enable "send alive packets" -- heart-symbol on right toolbar
- Type in VESC terminal: foc_openloop 20 6000
- Sampled data: press sample now, and show FFT Plot and zoom the plot to see a peak at 6000/60 = 100 Hz (but in my case the peak is at 133 Hz)
- Repeat with other settings of Motor Settings --> FOC --> Advanced --> Switching Frequency (and observe that the measured frequency changes)
- Repeat with other settings of Motor Settings --> FOC --> Advanced --> Sample in V0 and V7 (and observe that the measured frequency changes)
I used VESC Tool Original 0.94 for Windows (but this is probably consistent in other versions)
You would expect the frequency to change when you change those settings. What do you mean by "reported frequency of a signal varies PWM frequency and sampling mode"?
@TechAUmNu: This might me obvious, but when I make FFT of a 100 Hz sine signal, then I expect to see a peak at 100 Hz (and not a 50 Hz, 133 Hz or 200 Hz).
The command "foc_openloop 20 6000" requests the VESC to output 20A amplitude sine at 100 Hz, in each of the 3 phases -- regardless of PWM frequency and sampling modes.
The reported (measured) frequency is the location of a peak in the FFT-graph of measured current.
Those settings should NOT change the current frequency (they only apply to PWM and sampling frequency).
Ah I see what you mean now. Yeah it shouldn't change. So something about foc openloop or how it generates the signal is time based on the rate the observer runs at.