TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker or making a Paypal contribution here: paypal.me/SupportTMC

Tesla Vehicle Log Graphing application for Mac OS X

Discussion in 'Roadster: Technical' started by S-2000 Roadster, Jun 29, 2011.

  1. S-2000 Roadster

    Joined:
    Apr 10, 2009
    Messages:
    636
    #1 S-2000 Roadster, Jun 29, 2011
    Last edited: Oct 8, 2014
    Hi folks,

    Download from here - http://www.audiobanshee.com/software/TeslaLogs.dmg

    This is Version 1, but really should be 0.8 or something. It should run on Tiger or newer, and on PowerPC or Intel. I'll try to quickly go through the strange stuff first, followed by a brief guide.

    [EDIT: This is now Version 2.25 - see the latest ReadMe for up to date descriptions]


    A) To view VehicleLogs, you must first use the OSX Finder to uncompress the .tar file and then drag the corresponding top directory onto the Tesla.app icon. Something about NSDocument does not like opening a directory instead of a file, especially without a package extension, so I'll have to fix this later.


    B) There is a Charge Log window and a Drive Log window for each Vehicle Log directory that is opened. It seemed too crowded to merge both, even though you obviously cannot charge and drive at the same time.


    1) The Charge Log window ends up with the directory name, which is in the YearMoDaHrMn naming convention showing when the Roadster created the tar file.

    a) It shows battery charge level in green as a percentage, with a legend for 100% (full range), 85% (full standard), 70%, 60%, 50% (long term storage), 25%, 10% (warning level), and 0% marked.

    b) Charging voltage is shown in orange, with 240V, 220V, 208V, and 120V marked on the legend.

    c) Charging current is shown in red, with 70A, 60A, 48A, 40A, 32A, 16A, and 12A marked on the legend.

    d) Available charge current is shown as a light orange background behind the actual charging current. The logs only update this value once every 30 minutes, so the end and sometimes even the beginning times can be delayed, and gaps may be apparent even though the disconnect was only brief - I'm at the mercy of the information available in the log. This value shows the 'maximum' available, although sometimes you'll see actual current briefly go above this maximum.


    2) The Drive Log is a bit too busy at the moment, what with the VehicleLogs having values that are updated for every second that the Roadster is on. It can be tough to scroll around through such fine detail, especially if your Roadster sits off for long periods of time.

    a) ESS Voltage is shown as a light orange background behind any time range when the car is on. There is a mark for 400V in the legend, which seems like the typical level, and you can see battery voltage dip whenever massive current is pulled.

    b) ESS Current (in red) is positive during regeneration and negative during normal driving. Regeneration seems to be limited to around 100A, which is marked on the legend, but performance can pull as much as 800A. There are markings for 0A, -200A, -400A, -600A, and -800A on the legend.

    c) I chose to scale the Speed data (in blue) such that the 160 mph speedometer maximum is at the top of the window. There is a marking for the maximum actual speed of 125 mph, along with 100 mph, 80 mph, 60 mph, 20 mph, and 0 mph.

    d) Torque is shown in purple, but there are no markers since I didn't want to crowd the legend with Newton-meters and/or Pound-feet. Future versions may make this clearer.

    e) Accelerator pedal position is shown in green, scaled to the height of the window. Flooring the pedal will graph at the top, while completely releasing will appear at the bottom.


    3) Both windows allow zooming out with a mouse click, zooming in with a right mouse click, and fine control over zoom via the mouse scroll wheel or two-finger scrolling on a multi-touch trackpad. The height of the graph always scales to full window height, but the width allows zooming and shows the Month and Day along with tick marks for Hours and Minutes. There are some drawing errors when scrolling, but resizing the window will redraw the date legend correctly. There is obviously much room for improvement.
     
  2. scott451

    scott451 KWH-PWR#1349Sprt,S Sig#96

    Joined:
    Apr 2, 2009
    Messages:
    251
    Location:
    Palo Alto

    Nice work! Send me a PM with your email and I'll send you my code. For your eyes only.
     
  3. S-2000 Roadster

    Joined:
    Apr 10, 2009
    Messages:
    636
    Known Issue: Version 1 does not read Roadster 1.5 logs ... I only tested with my Roadster 2.5 files. The next release will support the old hardware.
     
  4. Nvbob

    Nvbob Roadster 1256

    Joined:
    May 6, 2009
    Messages:
    229
    Location:
    Just east of Lake Tahoe, Ca.
    S-2000 - Thank you! I have downloaded it and will try it out!
     
  5. daniel

    daniel Active Member

    Joined:
    May 7, 2009
    Messages:
    1,131
    Location:
    Spokane, WA
    I've seen the occasional thread or post where someone comments on being able to read some information such as when and how far the car was driven, maybe how fast, I'm not sure. Are they using a program such as this? Or is some of that information available on the touch screen without equipment or software? It came up in the context of being able to see driving patterns before the owner got the car, so reading past information, not merely the latest drive.
     
  6. S-2000 Roadster

    Joined:
    Apr 10, 2009
    Messages:
    636
    #6 S-2000 Roadster, Jul 2, 2011
    Last edited: Sep 9, 2014
    Version 1.5 Release

    Serious improvements are here with Version 1.5

    http://www.sounds.wa.com/software/TeslaLogs.dmg

    Support for Roadster 1.5 should make this application useful for far more owners.

    Thanks to Tom's suggestions, you are no longer required to use Finder to unpack the .tar file and drag it onto the app icon. Just open the .tar file as it comes from the Tesla memory stick, and now the File Open dialog is happy.

    Other features include a master document panel with the VIN, birthday, initial versions and latest version of the firmware installed. Buttons to locate the Charge Log and Drive Log are located on this panel to help find the right windows when you have multiple VehicleLogs files open at the same time. Closing the master document panel will close the associated log windows.

    The mouse scroll wheel and trackpad multitouch now work much better so that you can easily zoom in on areas of interest without a lot of hunting in the scroll view. There are also menu items for the master document panel to set the scale in the associated windows to a few preset values so that you can compare logs from different files on the same time frame.
     
  7. kgb

    kgb Member

    Joined:
    Sep 22, 2009
    Messages:
    605
    Location:
    Houston, TX
    I just want to chime in a big "thank you." Not enough people develop for the Mac OS. I appreciate your efforts

    Now I need to figure out how to sync this data with the video of track time. ;)
     
  8. S-2000 Roadster

    Joined:
    Apr 10, 2009
    Messages:
    636
    You're welcome. I guess the next step is an iOS version that can directly read from an attached Tesla memory stick. :wink:

    If you have a professional camera with SMPTE sync set to accurate wall clock time then that can be converted to the Unix time format in the VehicleLogs. That would be an interesting project... :cool:
     
  9. markwj

    markwj Moderator, Asia Pacific

    Joined:
    Apr 10, 2011
    Messages:
    3,665
    Location:
    Hong Kong
    What I'm interested in is getting the track logs from the Alpine nav unit combined with the consumption logs from the VMS. Overlay it in a google maps 3D flyby view with onscreen accelerator pedal and consumption figures. Maybe a nice soundtrack ;-) The track logs and map are done. Something like:

    http://www.youtube.com/watch?v=6yrUEvcZoMU
     
  10. mpt

    mpt Electrics are back

    Joined:
    Oct 15, 2008
    Messages:
    1,629
    Location:
    Warren, New Jersey, United States
    This is great; right down to the app icon. It took a moment to get to grips with the UI and I'll play some more but looking really good; very cool. Thanks!
     
  11. mpt

    mpt Electrics are back

    Joined:
    Oct 15, 2008
    Messages:
    1,629
    Location:
    Warren, New Jersey, United States
    UI enhancement request: Whilst I can get about, how about:
    1. Limiting zoom to the mouse wheel only (or have a +/- somewhere) and allowing mouse click/drag to move the time line
    2. Allow greater zoom
    3. Use the right hand side of the graph for a second Y-axis ledgend
    4. When zoomed in show hour/minute and maybe sec on on the time line. Such as:

    June 2 2011
    12:00 13:00 14:00
    0 15 30 45 0 15 30 45 0 15 30 45


    Thanks!
     
  12. S-2000 Roadster

    Joined:
    Apr 10, 2009
    Messages:
    636
    Yes, the click-to-zoom is rather stupid, but it was the first thing I got working before the scroll wheel. I think that the scroller UI should be sufficient to move the time line without have click/drag do the same thing. What I particularly want to implement is click/drag to make a selection that will zoom to full size - that way you can outline an area of interest and maximize it.

    Right now, the limit is 1 pixel = 1 second. It didn't seem to make much sense to zoom in any more than that, because there isn't any more data at a finer resolution that 1 second. I agree, though, that the driving log might be more discernible at a slightly higher zoom ... maybe 2 or 3 pixels per second.

    That's a great suggestion, but it would be a significant change. The left hand and upper "rulers" are a standard feature of Cocoa that takes very little coding to support. Putting a ruler on the right and/or bottom would require additional Kung Fu. Might be something to look into, though.

    That's certainly possible. For a while, I had a feature working where if you were zoomed in far enough that the month divider wasn't showing then it would still show the month along the left edge. Same with Day. Unfortunately, that sort of pegged (non-scrolling) drawing caused a big mess (witness the defunct Version 1.0). There was also an hour in there. I could easily add hour and minute to the existing ruler, but it would only be drawn when you zoom in far enough for the text to fit (at least that's the way I would code it). I don't think I'll allow enough zoom for seconds to fit - the clock probably isn't set that accurately anyway.
     
  13. Nvbob

    Nvbob Roadster 1256

    Joined:
    May 6, 2009
    Messages:
    229
    Location:
    Just east of Lake Tahoe, Ca.
    App works great! Thank you so much for all your work!

    We viewed our log yesterday and was impressed by what we were able to see.
     
  14. kgb

    kgb Member

    Joined:
    Sep 22, 2009
    Messages:
    605
    Location:
    Houston, TX
    #14 kgb, Jul 6, 2011
    Last edited: Jul 6, 2011
    Suggestion:

    You admit that the idle time takes up a lot of space on the drive log. I couldn't help notice the same. Is it possible to simply remove the blank portions of the graph and replace them with a much smaller placeholder. Perhaps an icon indicating "Idle Time". This would save us from having to zoom out scroll and then zoom back in.

    I'd like to second the request for hour/minute markers when zoomed in.

    Anyone, feel free to answer this one: I noticed that I have no logs that pre-date my last Tesla Ranger visit. Did he delete those? Do I delete the logs by downloading them?
     
  15. S-2000 Roadster

    Joined:
    Apr 10, 2009
    Messages:
    636
    My process is to leave the message on the screen and wait for it to disappear on its own. That's when it's done. If you dismiss the message about the download then I don't know that you'd have any way to know when it's done (although I suspect that the '!' icon would disappear - the one that tells you a dismissed alert is still in effect). If you mistakenly dismiss the alert, you can get it back by touching the '!' icon, and I assume that you'd then know the download was finished when the alert subsequently disappears on its own.

    By the way, never try multitasking by charging and downloading at the same time. I have one botched vehicle log download from the one time I tried this; the car did not seem happy. My OSX application can still read this botched file even though the Finder cannot unpack the .tar file, but I wouldn't recommend upsetting the Roadster computer. Only try downloading when the car is not doing anything else - not even idling.

    I have no idea what causes logs to be deleted, but I can say that multiple downloads have given me overlapping data, so downloading to a memory stick does not clear them out all on its own. I, too, had my logs truncated by a firmware upgrade, but I imagine that is SOP, considering that the temporary log format may change between firmware revisions. I assume that the permanent log cannot change format - otherwise it wouldn't be permanent (although the format is extensible to a degree that some minor details could change).

    As you're probably aware, the temporary log files do overlap at a certain point in time. If you let your car 'idle' for long periods of time, you're basically eating up memory very fast since one message per second is logged when the key is inserted and the car is on. Eventually, you history will be overwritten even if you never visit Tesla service. Now that I'm (hopefully temporarily) fascinated by the VehicleLogs, I refrain from leaving my key in the car unless it's moving. ... probably decreases my odds of having the car stolen from my front yard, too.
     
  16. S-2000 Roadster

    Joined:
    Apr 10, 2009
    Messages:
    636
    Thanks again for the suggestions. Items 2 and 4 have been implemented and will be in the next release.
     
  17. S-2000 Roadster

    Joined:
    Apr 10, 2009
    Messages:
    636
    The graphing code is much simpler, easier, and faster when everything is on a linear scale. Scrolling through time where some sections are compressed and others are not would be highly problematic. I have two ideas for solving this problem:
    A) Put markers in the scroller background to hint at where non-blank portions are. Click-to-scroll on those markers would make finding the drive logs easier.
    B) The main window really should have date/time search inputs to restrict the display to a range of time, rather than simply the entire log. Perhaps clicking in the log window with a modifier key would set the starting or ending time for the visible range. That, or scrollers to set the limits.

    In any case, this feature may need to evolve over multiple releases as I try different solutions.
     
  18. kgb

    kgb Member

    Joined:
    Sep 22, 2009
    Messages:
    605
    Location:
    Houston, TX
    You must have been working on this reply when I deleted this question from my post. The reason is: After I posted the question, I stumbled upon the answer and I thought I removed the question before anyone had time to see it. The actual answer was on my Tesla Motors flash drive. There is a text file there that answers my question, and one of yours.

    pertinent parts reproduced here:
     
  19. Nik

    Nik Dreaming no more :-(

    Joined:
    Jan 18, 2011
    Messages:
    244
    Location:
    Cambridge, UK
    There was a question in a thread about PINs for accessing maintenance screens on the VDS, and whether or not TM was staffed by geeks. I think this gives us definitive proof.
     
  20. kgb

    kgb Member

    Joined:
    Sep 22, 2009
    Messages:
    605
    Location:
    Houston, TX
    I didn't point that out, but I noticed that too when I read it... but then I thought, "Is it bad that I know what they mean?"
     

Share This Page