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

Extremely accurate performance data from the CAN bus

Discussion in 'Model S: Driving Dynamics' started by wk057, Dec 16, 2015.

  1. wk057

    wk057 Senior Tinkerer

    Joined:
    Feb 23, 2014
    Messages:
    4,715
    Location:
    Hickory, NC, USA
    #1 wk057, Dec 16, 2015
    Last edited: Dec 16, 2015
    Hi everyone.

    If you haven't seen my Let the hacking begin... (Model S parts on the bench) thread, you should maybe give it a glance. :)

    Building on info I've already been able to gather from my efforts I've managed to decode quite a bit of the data that flies along Tesla's high speed CAN buses, accessible in a pretty noninvasive manner under the 17" screen.

    Specifically, so far, the power consumption data and speed, among other things. This is pretty ideal for performance benchmarks. The car gives a lot of info. The power data alone has 10ms resolution (100 Hz sampling!). The speed is accurate to 0.1 MPH at 10 Hz sampling. This is really better than vbox quality data, and it's coming directly from the car. It's also faster sample rate and higher resolution than the REST API.

    Here are some data log graphs I made of some launches this evening:

    launch1-CANgraph.jpg

    launch2-CANgraph.jpg

    Pretty nice data. Using this data and a little bit of software I can calculate all sorts of stuff. Acceleration (G force), horsepower, high accuracy energy efficiency graphing (way higher resolution than Tesla's in-dash graphs expose), etc etc etc.

    I figured it was cool and was worth sharing outside of being buried 90 posts in on my other thread.

    I'm debating on whether or not it would be worth whipping up a standalone device that I could keep connected to the car all the time that could log and display all sorts of data like this. Maybe something as simple as a Raspberry Pi with the touch screen attachment and a CAN interface in a 3D printed case. This is admittedly a bit outside of the original scope of my other thread as well. While related, and wouldn't have been possible without my other efforts, this is definitely yet another side project.
     
  2. DoctorJJ

    DoctorJJ Member

    Joined:
    Nov 14, 2014
    Messages:
    91
    Location:
    Oklahoma
    That's really cool stuff. Thanks for sharing.
     
  3. jerjozwik

    jerjozwik Member

    Joined:
    May 12, 2014
    Messages:
    699
    Location:
    san gabriel valley
    nice hacking.
     
  4. MikeBur

    MikeBur ManualPilot

    Joined:
    Dec 8, 2014
    Messages:
    579
    Location:
    Seattle, WA
    Very, very, cool... Massive V drop, as you predicted, and this is huge! Thanks.

    Love concept of hard-wired data capture using raspberry pi. Rather than touch screen, how about a BT transmitter and then enable others to visualize the data on phones? Similar to how this is done on ICE cars with data from the OBD-II port? Just a thought.

    btw other thread is great, thanks for that too.
     
  5. Tedkidd

    Tedkidd Member

    Joined:
    Dec 8, 2013
    Messages:
    612
    Location:
    Rochester, New York, United States
    #5 Tedkidd, Dec 16, 2015
    Last edited: Dec 16, 2015
    Jason, have you reached out to Jack Rickard at EVTV?
     
  6. wk057

    wk057 Senior Tinkerer

    Joined:
    Feb 23, 2014
    Messages:
    4,715
    Location:
    Hickory, NC, USA
    I have. I'm actually using the device from his site to log the CAN data on the real cars. EVTV Motor Verks Store: SavvyCAN for Tesla Model S, CAN Tools, TeslaCANKit. We've tossed some info back and forth. Those conversations aren't public, however.

    Anyway, the CAN device just captures the raw not decoded CAN data, though. So far the pieces gathered like battery voltage and such I've decoded by playing back CAN data to my bench setup and modifying it until I figure out what the IC is doing with it. Can't really safely do that on a live car. :)
     
  7. Tedkidd

    Tedkidd Member

    Joined:
    Dec 8, 2013
    Messages:
    612
    Location:
    Rochester, New York, United States
    So this stuff feels way over my head but seems what you are doing might be something he'd want to offer, rather than building from scratch.
     
  8. wk057

    wk057 Senior Tinkerer

    Joined:
    Feb 23, 2014
    Messages:
    4,715
    Location:
    Hickory, NC, USA
    Probably so. And honestly, I hope he does. Would save me the trouble of making one for myself. :biggrin:
     
  9. stopcrazypp

    stopcrazypp Well-Known Member

    Joined:
    Dec 8, 2007
    Messages:
    7,039
    Small nitpick. The speed is precise to 0.1 MPH. It may not be as accurate as a vbox because your speedometer speed is unlikely to be your actual speed.

    Thumbs up on the rest though. I believe you are the first to pull real-time battery voltage data and that's definitely a significant achievement.
     
  10. sandpiper

    sandpiper Active Member

    Joined:
    Sep 25, 2014
    Messages:
    1,463
    Location:
    Ontario, Canada
    Great stuff! Provide the data acquisition unit with bluetooth transmitter and you've got the makings of a must-have device for us Tesla nerds!
     
  11. Chasedrgc1223

    Chasedrgc1223 Nearly Insane

    Joined:
    Apr 8, 2015
    Messages:
    229
    Location:
    NJ
    Would love to see some CAN data from the 85D, and compare data to the P85D to see how different the power delivery is.
     
  12. bonnie

    bonnie Oil is for sissies.

    Joined:
    Feb 6, 2011
    Messages:
    14,241
    Location:
    Columbia River Gorge
    Good idea, seem like a good match. :)
     
  13. JST

    JST Active Member

    Joined:
    May 23, 2013
    Messages:
    1,506
    I'd love to have a device that could grab this data and then export it over Bluetooth or similar to an iOS app...
     
  14. David99

    David99 Active Member

    Joined:
    Jan 31, 2014
    Messages:
    2,048
    Location:
    Brea, Orange County
    Dude! You are my hero! :) Sign me up as a tester!
     
  15. sorka

    sorka Active Member

    Joined:
    Feb 28, 2015
    Messages:
    3,256
    Location:
    Merced, CA
    Did the voltage really drop to something like 260?

    Was that around 65 to 70% SOC?
     
  16. brianman

    brianman Burrito Founder

    Joined:
    Nov 10, 2011
    Messages:
    15,487
    The vertical axis lines are confusing to me. Can you clean those up?

    YAxis.png
     
  17. benf

    benf Member

    Joined:
    Oct 20, 2015
    Messages:
    121
    Location:
    Yorba Linda, CA
    While the resolution/refresh rate is 5 (or 10, depending on version) times better than the vbox, I'm assuming the speed it's reporting is from the wheel sensors and not GPS speed, correct? The wheel sensors seem to be pretty optimistic, as my speedo is about 1 mph fast at 60mph.

    Either way, awesome hacking :)
     
  18. wk057

    wk057 Senior Tinkerer

    Joined:
    Feb 23, 2014
    Messages:
    4,715
    Location:
    Hickory, NC, USA
    There are two vertical axes, one for kW and voltage on the left, and the other for MPH on the right. Kind of a consequence of trying to put a bunch of data in one graph.

    I do believe it's from a combination of sensors, but I can't be sure. I've found it to be reasonably accurate. Perhaps a hair optimistic, but not by much.
     
  19. Bangor Bob

    Bangor Bob Member

    Joined:
    Jan 5, 2015
    Messages:
    484
    Location:
    Bangor, ME
    "Pretty optimistic?" Don't ever ride a motorcycle, the speedo's on those are generally 10-15% optimistic (while the odometers are about bang-on...).

    Very cool stuff. An adapter to plug a bluetooth CAN/OBD connector onto the diagnostic plug would probably be a handy thing.

    Datalog an autopilot drive might be interesting, spesh if you can pair it up with GPS position and drop it onto a Google map...

    To get pack group voltages it's probably easiest to log a 100% charge session, they may hit the bus as the BMS talks to the main computer during balancing. The non-standard PID list for an S or an X must be immense.
     
  20. apacheguy

    apacheguy Sig 255, VIN 320

    Joined:
    Oct 21, 2012
    Messages:
    3,705
    Location:
    So Cal
    Would love to know how high the BMS lets the pack temps get when the car is parked and sleeping in a hot parking lot.
     

Share This Page