The logging with combined binary data and sport values is now working and the results look pretty good. The data is logged to the card whenever the inverter is running and there is no wifi connection to the ESP32. The file can then be copied off the SD card and decoded using a PC app. It generates two csv files, one for the control loop data and one for the spot values.
Code: Select all
Time (s),count,angle,frq,i1,i2,pwm1,opmode,pwm2,desat,pwm3,iqref,idref,ifw,uq,ud,spot,csum,iq,id,
0,39,346.25,0,0.25,0,-0.685714,1,-0.304762,0,0.666667,0,0,0,-0.595155,-0.377286,0,58,0.199621,0.20853,
6.25e-05,40,346.25,0,0,0,-0.495238,1,-0.304762,0,0.47619,0,0,0,-0.45168,-0.233811,4,101,0,0,
0.000125,41,346.25,0,0,0,-0.380952,1,-0.304762,0,0.361905,0,0,0,-0.3826,-0.159417,0,125,0,0,
0.0001875,42,346.25,0,0,0,-0.285714,1,-0.285714,0,0.266667,0,0,0,-0.313519,-0.0850222,0,154,0,0,
0.00025,43,346.25,0,0,0,-0.342857,1,-0.152381,0,0.32381,0,0,0,-0.281636,-0.180672,0,150,0,0,
0.0003125,44,346.25,0,-0.25,-0.25,0.47619,1,0.685714,0,-0.685714,0,0,0,0.733317,0.111592,242,144,-0.480024,-0.139918,
Code: Select all
Time (s),opmode,lasterr,status,pwmmax,pwmirqfrq,udc,idc,il1,il2,id,iq,ifw,ud,uq,fstat,speed,cruisespeed,amp,angle,pot,pot2,regen,potnom,dir,tmphs,tmpm,uaux,pwmio,canio,testangle,din_start,din_brake,din_forward,din_reverse,cpuload,
0.0295625,1,13,0,10500,16000,32,0,-0.34375,0.03125,-0.21875,-0.375,0,32.5,-319.656,0,0,-1,514.969,346.219,22,23,23,0,0,20,299,0,0,0,0,0,0,0,0,34.1875,
0.0455625,1,13,0,10500,16000,32,0,0,0.1875,-0.125,-0.46875,0,-87.7188,240.875,0,0,-1,185.531,346.219,22,23,23,0,0,20,299,0,0,0,0,0,0,0,0,38.2813,
0.0615625,1,13,0,10500,16000,32,0,0,0.09375,-0.15625,0.375,0,-25.7188,-141.313,0,0,-1,445.75,346.219,23,23,23,0,0,20,299,0,0,0,0,0,0,0,0,38.2813,
0.0775625,1,13,0,10500,16000,32,0,-0.1875,0.0625,0.125,0.09375,0,-173.688,461.938,0,0,-1,90.3125,346.219,22,23,22,0,0,20,299,0,0,0,0,0,0,0,0,38.2813,
0.0935625,1,13,0,10500,16000,32,0,0.09375,0.28125,0.125,0.375,0,-34.2188,-178.406,0,0,-1,125.063,346.219,23,23,22,0,0,20,299,0,0,0,0,0,0,0,0,38.2813,
0.109562,1,13,0,10500,16000,32,0,0.03125,0.125,0.0625,-0.125,0,104.563,-114.344,0,0,-1,548.75,346.219,23,23,23,0,0,20,299,0,0,0,0,0,0,0,0,38.2813,
0.125562,1,13,0,10500,16000,32,0,0.25,-0.5,0,-0.125,0,36.6875,-208.063,0,0,-1,56.25,346.219,22,23,22,0,0,20,299,0,0,0,0,0,0,0,0,38.2813,
Both can be imported straight into a spreadsheet to allow the data to be plotted, for example a couple of graphs generated from the spot values on a 1min test run:
The control loop data can also be analysed in a spreadsheet but the files are large so it is pretty slow. The plan was to use PulseView to analyse them (see the logging thread for more details) but there is a problem. This is what's plotted:
The problem is most obvious on il1 and il2 and is most easily seen in the highlighted area, the motor is actually stationary here! Plotting the same data file using gnuplot gives:
Which is what il1 should look like. Looks like PulseView may not be able to cope with these files
Have tried a few things to fix it but so far no luck so now looking for another application to use for analysis.
Happy with the SD card logging now anyway.