You are here

FFT in VESC Tool

4 posts / 0 new
Last post
RSR
Offline
Last seen: 2 months 4 days ago
VESC Original
Joined: 2017-05-24 12:46
Posts: 38
FFT in VESC Tool

The reported frequency of a signal varies PWM frequency and sampling mode.   Is this a bug?

How to reproduce:

  1. Connect motor, power, PC, start VESC Tool and tune FOC operation 
  2. Enable "send alive packets" -- heart-symbol on right toolbar
  3. Type in VESC terminal:  foc_openloop 20 6000
  4. 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)
  5. Repeat with other settings of Motor Settings --> FOC --> Advanced --> Switching Frequency  (and observe that the measured frequency changes)
  6. 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)

TechAUmNu
Offline
Last seen: 2 weeks 4 days ago
VESC Free
Joined: 2017-09-22 01:27
Posts: 575

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"?

RSR
Offline
Last seen: 2 months 4 days ago
VESC Original
Joined: 2017-05-24 12:46
Posts: 38

@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).

 

TechAUmNu
Offline
Last seen: 2 weeks 4 days ago
VESC Free
Joined: 2017-09-22 01:27
Posts: 575

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.