Open Source ESC Video Logging on Electric Longboard

In order to get an impression about what the load looks like while using my open source ESC on an electric longboard, I wrote a program using Qt and opencv to do real-time video overlay logging while testing. This is the first test I made in my basement:

Four threads are used:

  1. Capture images from the webcam (framegrabber.cpp).
  2. Overlay the images with real-time information and graphs (frameplotter.cpp).
  3. Encode a x264 video from the images (videocoder.cpp).
  4. Record audio, fetch data from the ESC and keep everything in sync (logger.cpp).

The source code and a small description on how to install and use it can be found on github;

Here is one indoor test in the V-building at Chalmers University test where the temperature is logged as well:

and this is one outdoor test with some uphills around chalmers:

I have been using my laptop with an external webcam for the tests in the videos, but it also works on my odroid u3 with lower resolution.

6 thoughts on “Open Source ESC Video Logging on Electric Longboard

  1. Very cool, I see thats the new board.

    Why is the motor current higher than the battery current? You get the motor current from the 2 shunts below the mosfets, I’m not sure where do you get the batt current from.

    Great job man

    • Thanks!

      The battery current is lower as long as the duty cycle is lower than 100%. This is because the motor only draws current from the battery during the on-period of the switching cycle and the capacitors average these current pulses to a lower continuous current. Therefore, the battery current can be calculated by simply multiplying the motor current with the duty cycle.

      Have you received your boards?

  2. Um, I still don’t quite follow, if you draw an average 20A from the battery you can’t get an average 22A in the motor, so I’m missing something there.

    And nope, its still in transit, and I’m kind of worried

    • It works like a buck converter by using the inductance in the windings of the motor. Regenerative braking work in the other way, like a boost converter.

      That is kind of strange. I could send you three more PCBs with a tracking number. I don’t think I will use all of them anyway since I have made two new versions. You can send me an email about that.

  3. Hi Benjamin,

    trying to compile your tool but finally got stucked somehow. After installing opencv I do qmake and make to build the bldc-logger. Then I get the following error:

    videocoder.h:50:5: error: ‘VideoWriter’ in namespace ‘cv’ does not name a type
    cv::VideoWriter mVideoWriter;

    Any idea, where I have made a mistake (I can’t interpret the error”). Thanks!


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.