Now the standard web interface does plotting, and it does it very well, but while trying to diagnose intermittent problems it has a couple of limitations. First the user has to be connected and plotting data to capture it - not ideal for intermittent problems. Second it has limited time resolution, for example if grabbing 1000points it manages 0.6sec resolution, at 100points it gives 0.3sec resolution. This doesn't sound too bad until you realise that in this 300ms the motor control loop has run 2650 times. We do get the min, max and average for each sample but even those only capture 3% of the control loop runs. Now for analysing vehicle behaviour this is more than enough but when trying to figure out why a control loop is misbehaving, or why an inverter is tripping out, it leaves a little to be desired.
To try and address this the idea is to produce a version of the web interface that:
- Runs on the ESP32
- Provides as much of the functionality of the current ESP8266 based code as possible
- When there are no connections to the web page it instead enters a fast logging mode and writes the data to an attached SD card
- In the fast logging mode it logs all the essential data on every run of the control loop (estimated to be around 200kB/sec, or 12MB/min)
- Allows files from the SD card to be browsed and downloaded via the web interface (or ftp?, ssh?)
So the plan is to port the current web interface build to the ESP32, add support for the SD card and add a fast logging mode to the firmware. I'm going to do the C based bits and Bigpie is going to do the web page based bits (which I know nothing about) and then hopefully use the product to figure out why his inverter keeps tripping out.