With the new web_based SFStudie being proposed/developed, I think it is a good time to discuss the actual datarate possible through typical MCU to PC/MAC USB interface or some other way BLE/WiFi etc.
The actual data-points available per pwm cycle or electrical revolution is important for the data-quality. Naturally we want the highest possible resolution when analyzing a controller/motor.
First off, I would like to invite everyone interested in this subject to run a test on what ever hardware you are using. What kind of datarate can you achieve running SimpleFoc to SimpleFocStudio?
Now let’s extrapolate some numbers:
As I understand it. The USB full-speed protocol used by most mid-range MCUs has a 1ms polling-rate. So in theory, if we are “only” sending one char per frame/transfer, we have a 1KB/s datarate, not so much.
Each variable has an identifier plus the variable itself, let’s make that a float with two decimals. If we want to compare four variables, we will have a aproxima payload per data-point of eg. 30 bytes. 1000bytes/s / 30 bytes is 33 data-points per secund.
If doing 25kHz pwm switching we will then, if above is true, switch 757.5 times per datapoint available.
Recently I was looking at the possible use of QSPI NOR FLASH for the same purpose (logging data).
A typical high speed Quad-SPI NOR flash has a 66MB/s datarate. That’s 2.000.000 datapoints (30 bytes).
Doing 25kHz in this scenario gives us 80 datapoints per pwm cycle. In theory…