User avatar
turbo2ltr
Posts: 1376
Joined: Fri Jul 30, 2010 11:13 pm
Delivery Date: 04 Feb 2011
Leaf Number: 185
Location: Phoenix, AZ

My findings on the CAN bus

Sun Feb 20, 2011 1:51 pm

I am going to preface this with a disclaimer. I have been in the business of automotive datalogging for the past 10 years. My primary reason for spending every waking moment for the past few weeks working on this is so I can make products that will pay the bills. I'm going to share some information I have found simply to benefit the community. I will not be sharing the detailed findings of my reverse engineering efforts. I feel I'm in a unique position market-wise (having a car very early in the game) and with the economy the way it is, I really *need* to take full advantage. With that said, please don't get upset if I don't answer your questions.


I deal with CAN almost daily, but it was always on products that were engineered by us or at the very least, we knew exactly what we were looking at via full documentation.

I used a CAN to USB adapter for all work. It's a straight CAN adapter, not one that tries to connect to OBDII.

I knew in order to get anything done, I'd need a way to process data efficiently. At the speeds the data comes over the bus, you end up with incredible amounts of data very quickly. This lead me realize I need to develop my own program. This program allows me to monitor data, "watch" variables, "play" previously saved log files in real time (or faster/slower) to simulate driving, and send out my own modified messages very easily. It was quick and dirty so it's not pretty but it worked great.

Image

My primary goal going in was to find a true SOC number. It seemed LEAF owners wanted this the most so I was intent on giving them that.

I found messages for:
  • range
  • the climate control +/- miles
  • SOC and capacity Bargraphs
  • All kinds of steering data such as steering angle, steering force and steering rate of change
  • Numbers that look like torque readings
  • per-wheel brake pressures
  • all kinds of status type of data.. Switches, parking brake, PRNDL, want to know if the left turn signal bulb is on? no problem.

Due to the nature of EVs, it is harder to differentiate between speed and motor RPM than ICE cars since they are coupled by single gear reduction box, so while I did find messages that appeared to be speed related, i did not pursue decoding the scaling of these parameters.

After initial excitement of finding the range/soc display controls, I quickly found out that the messages I found were just a way to control the dash. I was initially hoping the SOC would be sent to the dash and the dash would interpret the SOC into bargraphs. But no "computing" is done in the dash, the messages were strictly for controlling the dash.

So I continued my search and after a lot of searching and head scratching, I do believe I have found SOC.

Because there is no SOC numeric display to verify the findings, I had to do tests. The only feedback the car has is range and the SOC bargraphs. It was evident the bargraphs were not going to be useful for this (I'm not going to get into why). But if I send out my own message with a fake SOC value, the range on the dash changes. I needed to be sure that the number I thought was SOC wasn't really some range number. So I ran some tests.

I charged 100% last night which gave me 95 mile range. I plotted range vs what I suspected was SOC by sending out fake messages and observing the dash. I took note of where the battery low, battery very low and turtle mode were activated as well.

I then went for a 10 mile drive at 75-80 mph. My range went from 95 to 52 but I only lost two SOC bars, meaning the range adjusted for my forcasted driving style. I returned and plotted them again. By comparing the plots, one could see if the alleged SOC number was really SOC or was a range number that would have been corrected for driving style. You can see two distinct lines in the lot below. The lower one is the plot after I returned (I didn't plot nearly as many points).

Image

I again checked what values the low battery, very low battery and turtle mode occurred and the values did not change, despite the range at which those events occurred changing.

Prior to the highway run:
Low batt: 16mi
Very low bat: 8

After Highway run
Low Batt: 13
Very low bat: 6

There is no range displayed when turtle mode is activated, but it was triggered at the same SOC number both before and after the trip.

According to my math, Low battery warning happens at 18%. Very low battery happens at 9%. Turtle mode happens at 2%. Some of you guys have done tests, how does this compare with what you came up with?

So with that said, I am confident this is the number we seek. Now on to step two...bringing it to the consumers..
Silver SL-e
Ford F450 Crew Cab Hybrid Conversion

AndyH
Posts: 6384
Joined: Fri Apr 23, 2010 3:43 pm
Location: San Antonio

Re: My findings on the CAN bus

Sun Feb 20, 2011 1:58 pm

Wonderful work, Turbo! Thanks for keeping us in the loop as you see fit.

Product wise - are you thinking a 'scangauge' like appendage, or a software upgrade that brings a new or re-purposed display?

Are you able to catch the buss from the diagnostic port, or have you had to dig into the wiring?
Last edited by AndyH on Sun Feb 20, 2011 2:00 pm, edited 1 time in total.

User avatar
turbo2ltr
Posts: 1376
Joined: Fri Jul 30, 2010 11:13 pm
Delivery Date: 04 Feb 2011
Leaf Number: 185
Location: Phoenix, AZ

Re: My findings on the CAN bus

Sun Feb 20, 2011 2:00 pm

I have some ideas on working it into the existing dash display, but I need to do further testing. Not sure it will work. If it doesn't then yes, it will be a bit of hardware, probably something similar, but smaller than scangauge.
Silver SL-e
Ford F450 Crew Cab Hybrid Conversion

AndyH
Posts: 6384
Joined: Fri Apr 23, 2010 3:43 pm
Location: San Antonio

Re: My findings on the CAN bus

Sun Feb 20, 2011 2:01 pm

Cool.

Looks like my edit overlapped your post.

Are you able to work from the diagnostic port or did you have to tear into the wiring?
"The stupid become extinct."-Bill Mollison
2018 Outlander PHEV
2015 smart Electric Drive (lease ended Feb, 2018)
OpenEVSE Plus DIY

User avatar
turbo2ltr
Posts: 1376
Joined: Fri Jul 30, 2010 11:13 pm
Delivery Date: 04 Feb 2011
Leaf Number: 185
Location: Phoenix, AZ

Re: My findings on the CAN bus

Sun Feb 20, 2011 2:03 pm

I have not taken anything apart on the car (yet) :) So far everything was done form the port.
Silver SL-e
Ford F450 Crew Cab Hybrid Conversion

Googler
Posts: 101
Joined: Sat Jan 08, 2011 12:46 am

Re: My findings on the CAN bus

Sun Feb 20, 2011 2:07 pm

Very interesting work, and I would encourage you to continue it. I recently bought one of the bluetooth devices like this: http://www.amazon.com/Bluetooth-ELM-Sca ... B004B7YXOM and I've used my android phone with Torque https://market.android.com/details?id=org.prowl.torque to get information from my other car. All quite entertaining!

DaveNagy
Posts: 76
Joined: Sun May 16, 2010 9:34 pm
Delivery Date: 26 Jun 2015
Location: Livermore, CA (Nor-Cal)

Re: My findings on the CAN bus

Sun Feb 20, 2011 3:18 pm

Excellent job, Mr. Liter! (Or can I call you Turbo?) ;)

I think it's totally understandable that you want to monetize this in the early going. Hopefully people will understand.

I would be very interested in an Android "app" that could display some of this info. An iPhone app would appeal to others, no doubt. Would one of the aforementioned Bluetooth doohickies work for what you are doing? (Do they pass the data that you need?)

I like the idea of piping the SOC data to the existing display too, of course. Would you be "overloading" one of the existing variables to do this? Something like having the climate-control power "dial" show SOC instead?

Maybe one of the clocks?

User avatar
Jimmydreams
Posts: 1500
Joined: Fri Apr 23, 2010 6:44 pm
Delivery Date: 08 Jan 2011
Leaf Number: 0175
Location: Oceanside, Ca.
Contact: Website

Re: My findings on the CAN bus

Sun Feb 20, 2011 3:21 pm

I have a ScanGuageII that does CAN bus info. If you want me to help test your codes, let me know and I'll be happy to plug 'er in and see what we get.
JimmyD
http://www.jjhamilton.com/solar
Blue SL Leaf delivered 1/7/2011
EVP participant. EVSE: Blink
6.75kW PV solar

User avatar
turbo2ltr
Posts: 1376
Joined: Fri Jul 30, 2010 11:13 pm
Delivery Date: 04 Feb 2011
Leaf Number: 185
Location: Phoenix, AZ

Re: My findings on the CAN bus

Sun Feb 20, 2011 4:02 pm

I've never used a SG but i took a quick look (so I could be mistaken) through their manual. It seems the custom messages you can program are OBDII messages (686A...) Yes you can do OBDII over CAN, but everything I've done so far is at the CAN message level. I've been dealing with raw can messages already being broadcast on the bus. OBDII is a higher level protocol that requires a request in order to get a response.
Silver SL-e
Ford F450 Crew Cab Hybrid Conversion

User avatar
planet4ever
Posts: 4674
Joined: Sat Apr 03, 2010 9:53 pm
Delivery Date: 02 May 2011
Leaf Number: 1537
Location: Morgan Hill, CA, south of San Jose

Re: My findings on the CAN bus

Sun Feb 20, 2011 4:28 pm

turbo2ltr wrote:I have some ideas on working it into the existing dash display, but I need to do further testing. Not sure it will work. If it doesn't then yes, it will be a bit of hardware, probably something similar, but smaller than scangauge.

I think there are quite a few of us who will be more than willing to pay you for something that gives us a meaningful SOC. This is a truly exciting report!

Ray
End of April 2013: Traded my 2011 SL for a 2013 S with charge pkg.

Return to “Engineering”