You are here

Internal Data Logging

9 posts / 0 new
Last post
KS0n
Offline
Last seen: 4 years 10 months ago
Joined: 2017-12-15 11:03
Posts: 2
Internal Data Logging

Data logging directly to the flash memory of the STM32F4 would be convenient.

I'm not sure what variant of the F4 is used, but it can have up to 1MB of flash, which could store hours of data without additional hardware.

With the accelerometer of the VESC6, it would be nice to plot acceleration vs. current and power. If you have a GoPro, it you could overlay the stats without additional logging to a phone.

Roger Wolff
Offline
Last seen: 5 months 3 weeks ago
VESC FreeVESC Original
Joined: 2017-05-24 12:27
Posts: 202

The problem is that the CPU cannot execute instructions (from flash) while the flash is writing the data. The short version is: the CPU is halted for a few miliseconds during "write to flash" and that is unacceptable while controlling a motor. 

 

KS0n
Offline
Last seen: 4 years 10 months ago
Joined: 2017-12-15 11:03
Posts: 2

Makes sense, thanks.

mrendu43
Offline
Last seen: 1 month 1 day ago
VESC Free
Joined: 2021-03-05 13:44
Posts: 23

How about adding sd adpater to spi, or external 4-16MB flash  and logging to sd or flash directly from vesc?

vadicus
Offline
Last seen: 8 hours 57 min ago
VESC Free
Joined: 2018-08-17 07:26
Posts: 335

I am writing telemetry direct to a database in the cloud where it's immediately available for review and visualization via a browser or phone app. Logging frequnce is adjustable from 1 to 10 sec intervals.

No additional hardware needed, no messing with memory cards or downloading data. 

This has been tested with my 30kw controller running firmware 5.3 but should work with any vesc firmware 5.0 and up. I can set up test account if interested, just let me know.

 

iot_graph1.jpg

 

mrendu43
Offline
Last seen: 1 month 1 day ago
VESC Free
Joined: 2021-03-05 13:44
Posts: 23

How do you do that? 

Can you elaborate please?

Also im looking ant nrf51/52 bluetooth modules for vesc, and thinking that it will be possible to add automatic sd logging to them...

this modules have arm m0 inside, also have spi and are rely powerful little chip but tay are only reading data from vesc and sending to phone, i sure that with little modification to code sd logging can be possible.

 

vadicus
Offline
Last seen: 8 hours 57 min ago
VESC Free
Joined: 2018-08-17 07:26
Posts: 335

I use my own app that has the logging feature.

In the App store https://apps.apple.com/bn/app/pv-nextgen/id1546506749 and

Google Play: https://play.google.com/store/apps/details?id=com.powervelocity.PVNextGe...

it's designed primarily to support my controller that's running esp32 for comms but should work with NRF51/52 and vesc protocol overall as well although I haven't tested it with other vesc running controllers.

The telemetry data that the app gets from esp32 is sent to an online database and visualization web application if logging is selected in the app settings. Graphs become immediately available for review.

I do actually have a connector for an SD card in my controller and can use megabytes of data available in the esp32 (I use a 16Mb version, so tons of storage) but it's just too much work to pull the the card from the controller and load it to a computer. Well, I guess I can use WiFi on the esp32 to automate the retrieval, now that I am thinking about it. But it's still way easier to just fire up the app when I need to collect data and be able to review it right away. I think vesc tool works the same way, it just logs locally on the phone so you can retrieve and analyze the data later.

I think SD card would be a must if you have a compelling reason to always log data 100% of the time rather than on demand. Like maybe on a Mars rover.

 

 

 

 

mrendu43
Offline
Last seen: 1 month 1 day ago
VESC Free
Joined: 2021-03-05 13:44
Posts: 23

Hello thanks for sharing this app.

Can you please explain how to setup online database on witch data is logged?

vadicus
Offline
Last seen: 8 hours 57 min ago
VESC Free
Joined: 2018-08-17 07:26
Posts: 335

You would just create an account in the app as prompted when first connecting to a vesc via BLE. You'd need to confirm your account via email. Then you can use the same credentials to login to the graph dashboard under "Graph" menu. You can also access your data from a browser by going here: http://iot.powervelocity.com:8080/

The graphs are basic now, so I would like to hear any suggestions what kind of data you would like to see visualized.