DIY Electric Car Forums banner

1 - 8 of 8 Posts

·
Registered
Joined
·
248 Posts
Discussion Starter #1
I am only just beginning to learn CAN. With the help of a friend I was able to capture about 2 minutes worth of data from my Tesla Rav4 EV battery pack. I am told its standard Tesla code? Bites? I dont know what they are called. lol


I am very curious as to what the pack is saying. If anyone wants to check it out for me Id love to have it decoded.



How can I share it? I think I have seen people use Github. Should I post it there?


Thanks!
 

·
Registered
Joined
·
1,476 Posts
i wonder what's with all the "t's" at the beginning of each line? Maybe it's a time stamp indicator, but it's not clear what it is and doesn't seem long enough.

There are some patterns that appear and repeat, which may be the IDs.

What are you using to capture the data? is the sample rate high enough to catch all the traffic.

Also, what was the car doing during the 2 minute or short capture. Best to limit to short captures of a specific action, eg press and release the brake pedal several times over a short period, or the accel pedal, or shift down and up thru the gears with the brakes on. It's all about trying to detect a pattern that can be related in time to what action you were commanding.

For charging, measure the voltage and current with your meters and make a data scan every 20 minutes or so. This will help you translate the Hex values to engineering units.
 

·
Registered
Joined
·
248 Posts
Discussion Starter #5
i wonder what's with all the "t's" at the beginning of each line? Maybe it's a time stamp indicator, but it's not clear what it is and doesn't seem long enough.

There are some patterns that appear and repeat, which may be the IDs.

What are you using to capture the data? is the sample rate high enough to catch all the traffic.

Also, what was the car doing during the 2 minute or short capture. Best to limit to short captures of a specific action, eg press and release the brake pedal several times over a short period, or the accel pedal, or shift down and up thru the gears with the brakes on. It's all about trying to detect a pattern that can be related in time to what action you were commanding.

For charging, measure the voltage and current with your meters and make a data scan every 20 minutes or so. This will help you translate the Hex values to engineering units.

Its kind of a unique scan I think. It is a capture of data from a Tesla battery pack from a Rav4 EV. Its powered up but not connected to a car. I built a range extending trailer and this is from the Tesla battery on the trailer. So there isnt really anything to change. I could stop charging it or I can turn off the power to the pack. Other than that there really isnt any other interaction. I assume this is all data with cell temps, contactor status, charge level etc.

I wish I could answer your questions better. I have never seen CAN data before. I assumed this is how it was supposed to look. haha. I am really ignorant to CAN but I am hoping to learn.
 

·
Registered
Joined
·
1,476 Posts
i can't edit the spreadsheet on google, don't have permission,etc.

But i think i can see the data format and will try to decode the first few lines or "frames" of the short capture. Here is the raw data from your spreadsheet, all values are expressed in hexadecimal format, 0xnnnn or xnn are short-hand notations that are sometimes used to indicate that the values are Hex and not decimal numbers.:

t102607836480c900
t2028d859f0961405b414
t34288000000008002000
t2125000770ff80
t35280000000000000000
t2226000000000000
t3b280000000000000000
t2324320fab3a

The first 3 values after the "t" are the CAN ID, aka PID.
The fourth field contains the number of data bytes in the frame (max number of data bytes in a frame is (0x08) = 8.
The fifth thru the end then contain the data.
Here is a parsed version:

pid # data
102 6 07 83 64 80 c9 00
202 8 d8 59 f0 96 14 05 b4 14
342 8 80 00 00 00 08 00 20 00
212 5 00 07 70 ff 80
352 8 0000000000000000
222 6 000000000000
3b2 8 0000000000000000
232 4 32 0f ab 3a

Once you parse the fields in the spreadsheet, then you can convert the hex data values to decimal numbers and make calculations to determine the engineering values, eg temperature, volts, amps, etc.

The lower the PID number, the higher importance and priority it has on the CAN buss. So you can sort the spreadsheet to filter by PID to group them and notice changes and trends in values quickly. For example pid x102 and x202 seem to have rich data fields.

Usually the PIDs are not converted to decimal, only the data.

here's the first line again with conversion of the data fields:

hex, decimal
102 pid, not converted
6 6
07 7
83 131
64 100
80 128
c9 201
00 0

Generally folks work on this to develop a PID dictionary, which identifies what the data fields of the PID represent and how to convert the hex to engineering values.
 

·
Registered
Joined
·
248 Posts
Discussion Starter #7
Thank you for the info!
Is the data always broken up into pairs? i.e. 102 6 07 83 64 80 c9 00

Why do some have all or mostly zeros?



Is there a database of Tesla CAN data that I could search through to compare with these PID's?
 

·
Registered
Joined
·
1,476 Posts
Yes it is always pairs

computers can only use binary data to count, which is a base 2 counting scheme. a binary bit, "b", can only be in one of two states, either a 1 or a 0.

8 bits (bbbbbbbb) makes up one byte of data, which can range in decimal numbers from 0 to 255 (normal base 10 counting).

Hexadecimal notation, "h" is base 16 counting, and uses 0 thru 9 and A thru F to represent the value of 4 bits, also known as a nibble, which covers the decimal range from 0 to 15. so two hex values are always needed and used to denote the value of one byte--a high nib and a low nib. it can be written with a dash to show the details, but usually it is not used.

bbbb-bbbb = H-L = 0xhh or hh

for example if the motor current was 231 Amps, the computer would use a binary string 11100111 to represent that number.

1110-0111 = E-7 or 0xE7 or E7

If a number value is needed greater than 255, then another byte is added and the binary data would consist of sixteen bits.
 
1 - 8 of 8 Posts
Top