Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register
  • The final cut of the 9th episode of the Tesla Motors Club Podcast, featuring Chad Schwitters, the former president of Plug In America, is now available. You can watch it now on YouTube or listen to it on all major podcast networks.

Extremely accurate performance data from the CAN bus

wk057

Vendor & Senior Tinkerer
Feb 23, 2014
5,929
13,425
Hickory, NC, USA
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.

---

Edit: At some point my copyrighted externally hosted images were illegally copied from my external hosting and re-hosted directly by TMC without notice or permission. TMC was NEVER given permission to host and distribute my copyrighted images. I've corrected the image references. If my images are appropriated again without my permission I will be forced to take legal action.
 
Last edited:
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.
 

wk057

Vendor & Senior Tinkerer
Feb 23, 2014
5,929
13,425
Hickory, NC, USA
Have you reached out to Jack Rickard at EVTV?

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. :)
 

stopcrazypp

Well-Known Member
Dec 8, 2007
12,022
7,810
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.
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.
 
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 :)
 

wk057

Vendor & Senior Tinkerer
Feb 23, 2014
5,929
13,425
Hickory, NC, USA
The vertical axis lines are confusing to me. Can you clean those up?

View attachment 104680

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.

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 :)

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.
 
The wheel sensors seem to be pretty optimistic, as my speedo is about 1 mph fast at 60mph.

"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.
 

Products we're discussing on TMC...

About Us

Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.

Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


SUPPORT TMC
Top