GroundLoop
Posts: 1725
Joined: Mon Sep 13, 2010 9:31 pm

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 12:09 pm

Regarding ID 5B9, here's a full charge cycle from about 20% to 100%:

Code: Select all

07FF07FF28  ***** NEW ****** @   0m 0.553s                
014A07FF28 ^00000006B5000000 @   0m 1.575s                
014A67FF28 ^0000000000600000 @   0m 2.086s                
114A67FF28 ^0000001000000000 @   0m 3.108s                
194A67FF28 ^0000000800000000 @   1m 39.686s                
192C67FF28 ^0000000066000000 @   2m 8.812s                
190E67FF28 ^0000000022000000 @  14m 41.997s                
210E67FF28 ^0000003800000000 @  19m 5.152s                
20F067FF28 ^00000001FE000000 @  29m 22.414s                
28F067FF28 ^0000000800000000 @  39m 44.789s                
28D267FF28 ^0000000022000000 @  56m 36.019s                
30D267FF28 ^0000001800000000 @  65m 17.220s                
30B467FF28 ^0000000066000000 @  83m 49.110s                
38B467FF28 ^0000000800000000 @  92m 8.848s                
389667FF28 ^0000000022000000 @ 114m 12.289s                
409667FF28 ^0000007800000000 @ 124m 8.094s                
407867FF28 ^00000000EE000000 @ 144m 35.468s                
487867FF28 ^0000000800000000 @ 153m 8.490s                
485A67FF28 ^0000000022000000 @ 171m 49.071s                
505A67FF28 ^0000001800000000 @ 178m 17.421s                
503C67FF28 ^0000000066000000 @ 198m 0.343s                
583C67FF28 ^0000000800000000 @ 200m 22.395s                
583267FF28 ^000000000E000000 @ 206m 24.172s                
582867FF28 ^000000001A000000 @ 215m 47.785s                
581E67FF28 ^0000000036000000 @ 225m 13.955s                
601E67FF28 ^0000003800000000 @ 236m 47.871s                
601467FF28 ^000000000A000000 @ 237m 49.700s                
600A67FF28 ^000000001E000000 @ 249m 20.546s                
67FF67FF28 ^00000007F5000000 @ 276m 50.495s                
So not a lot of updates to the value itself, and a sudden jump from 0x600A to 0x67FF

User avatar
evnow
Moderator
Posts: 11480
Joined: Thu Apr 22, 2010 11:41 am
Delivery Date: 25 Feb 2011
Leaf Number: 303
Location: Seattle, WA

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 12:58 pm

I suggest looking at values at just 3 charging times. Start of charging, 80% charged and 100% charged. Use timed charging to stop at 80% and take reading.

Get a dump of all the codes and write a little program to narrow the ones you want to look at closely.
1st Leaf : 2/28/2011 to 5/6/2013
2nd Leaf : 5/4/2013 to 3/21/2017
Volt : 3/25/2017 to 5/25/2018
Model 3 : 5/10/2018 to ?

robtwn
Posts: 2
Joined: Sat Feb 19, 2011 4:18 pm

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 6:10 pm

Charging session with battery showing 1 red bar and
10-miles remaining. Low Battery previously indicated.
Charge proceeds until normal full-battery cutoff.
This data is for ID=1DA on the EV-CAN buss.
The timestamp is first, HHMMSS.milliseconds.
All messages have 8 valid data bytes, numbered
D1 (on the left) through D8 (on the right).
On this ID value, messages occur every 0.010 sec.,
so for convenience of presentation, many are omitted
when the D1 value does not change.
We also noted that the low 4-bits of D7 make
the transition from 0->1->2->3 in each successive
message. It also appears that the D8 value changes
significantly less rapidly when compared with the previous
message of the same D7 value. The first message shown
below is the 130-th from the start of the session, initiated by
plugging in the J1772 connector, and it's timestamp is roughly
200-ms into the session. The entire session record of this single
ID address is nearly 2-million records, is available on request.
The (12-byte record) binary file of this entire session is nearly 38 MB.

Notice the fast ramp up of value of D1.
175809.352 01 00 00 00 00 01 03 9A
175810.882 03 00 00 00 00 01 00 9E
175810.892 18 00 00 00 00 01 01 5A
175810.902 33 00 00 00 00 01 02 81
175810.912 4D 00 00 00 00 01 03 FB
175810.922 5D 00 00 00 00 01 00 81
175810.932 72 00 00 00 00 01 01 C9
175810.942 83 00 00 00 00 01 02 9B
175810.952 90 00 00 00 00 01 03 67
175810.962 98 00 00 00 00 01 00 55
175810.972 A0 00 00 00 00 01 01 78
175810.982 A4 00 00 00 00 01 02 6E
175810.992 A7 00 00 00 00 01 03 E2
175811.002 A9 00 00 00 00 01 00 C2
175811.012 AB 00 00 00 00 01 01 49
175811.023 AD 00 00 00 00 01 02 51
175811.032 AF 00 00 00 00 01 03 DA
175811.052 B0 00 00 00 00 01 01 08
175811.072 B1 00 00 00 00 01 03 80
175811.112 B2 00 00 00 00 01 03 89
175815.442 B3 00 18 00 00 01 00 FF
180017.354 B4 00 18 00 00 01 00 EA
180822.835 B5 00 18 00 00 01 03 E7
181652.706 B6 00 18 00 00 01 01 61
182541.966 B7 00 18 00 00 01 02 6C
183531.443 B8 00 18 00 00 01 01 4B
184506.091 B9 00 18 00 00 01 01 4C
185545.497 BA 00 18 00 00 01 01 45
190639.602 BB 00 18 00 00 01 03 CD
192517.275 BC 00 18 00 00 01 00 D2
194943.741 BD 00 18 00 00 01 02 5A
201457.028 BE 00 18 00 00 01 02 53
203801.382 BF 00 18 00 00 01 00 DB
205858.063 C0 00 18 00 00 01 02 AC
211854.468 C1 00 18 00 00 01 00 24
213854.924 C2 00 18 00 00 01 03 27
215604.737 C3 00 18 00 00 01 01 AF
221126.556 C4 00 18 00 00 01 03 35
224551.284 C5 00 18 00 00 01 01 BD
231603.954 C6 00 18 00 00 01 00 31

stable at these values (D1 is C6, D6 is 01)
231651.702 C6 00 18 00 00 01 03 3B
231642.713 C6 00 18 00 00 01 00 31
231646.763 C6 00 18 00 00 01 01 B4
231653.412 C6 00 18 00 00 01 02 BE

until this change in D6 (01->00)
234223.475 C6 00 00 00 00 00 03 D7
234223.485 C6 00 00 00 00 00 00 DD
234223.495 C6 00 00 00 00 00 01 58
234223.505 C6 00 00 00 00 00 02 52

about 1-sec later, a very fast drop off in D1
234224.515 C6 00 20 00 00 00 03 73
234224.525 C6 00 20 00 00 00 00 79
234224.545 C4 00 20 00 00 00 02 F8
234224.555 C3 00 20 00 00 00 03 68

and by 0.1-sec later, D1 is down to 16
234226.625 16 00 00 00 00 00 02 ED

shortly thereafter, D7 has the high bit set
234226.805 14 00 00 00 00 00 80 E5

until this last entry in the charge session
234327.172 02 00 00 00 00 00 81 02

Regards the K-line issue: my OBD too also fails to connect to the LEAF. I wasn't too surprised!
While I'm no expert, I've been told that for OBD to work on K-line cars, the L-line is REQUIRED
for hadshaking, so this may have something to do with my device not working.

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: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 8:43 pm

I previously thought the K line went to the TCU, but someone said it doesn't, so maybe it was the VPS box. I'm quite certain it was one of those two.

And yes, the L line is required for OBDII comms. K is optional. I think nissan just uses the K line for their consult.

Nice find Rob. I had not seen that. Not sure what it is though. The problem with all this stuff is you need some context to figure out scaling.


It is common to find parameters mapped and multiplexed in a single CAN message. When D7 is 0, D8 is the value for parameter X. When D7 is 1, D8 is the value for parameter Y, etc. If you split them out, I bet you'll see a pattern.


At this rate you guys will be able to make your own SOC gauge pretty soon. But it's fun watching...and learning. You guys are finding stuff I didn't.
Silver SL-e
Ford F450 Crew Cab Hybrid Conversion

GroundLoop
Posts: 1725
Joined: Mon Sep 13, 2010 9:31 pm

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 9:13 pm

Interesting 1DA messages!

I suspect the last byte is a checksum. I ran the previous seven through some CRC and CCITT algorithms, but nothing matched.

My pattern is similar to yours:

Code: Select all

ID 1DA: 8 BB00180000010000  @   2m 48.592s                 
ID 1DA: 8 BC00180000010000  @  14m 10.630s                 
ID 1DA: 8 BD00180000010000  @  34m 1.211s                 
ID 1DA: 8 BE00180000010000  @  58m 57.947s                 
ID 1DA: 8 BF00180000010000  @  83m 13.335s                 
ID 1DA: 8 C000180000010000  @ 105m 9.866s                 
ID 1DA: 8 C100180000010000  @ 125m 26.048s                 
ID 1DA: 8 C200180000010000  @ 145m 3.981s                 
ID 1DA: 8 C300180000010000  @ 160m 52.153s                 
ID 1DA: 8 C400180000010000  @ 172m 22.989s                 
ID 1DA: 8 C500180000010000  @ 201m 39.211s                 
ID 1DA: 8 C600180000010000  @ 235m 54.879s                 
ID 1DA: 8 C700180000010000  @ 262m 18.995s                 
ID 1DA: 8 C600180000010000  @ 276m 49.229s                 
then the middle '18' becomes '20' and a rapid descent through the values C7 -> 01 in 50 seconds or so.
Same patterns in the D6/D7 bytes as you saw.

User avatar
garygid
Gold Member
Posts: 12465
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 9:49 pm

The D1 might be current flow, as controlled by the charger?

Compare with a 120v (12A max) charge.
See SOC/GID-Meter and CAN-Do Info
2010 Prius, now for sale
2011 LEAF, sold in 2015
2018 Tesla Model 3
2014 Tesla S, Model 3 in 2019
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
To Sell: X-treme 5000Li EV motorcycle

User avatar
garygid
Gold Member
Posts: 12465
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 10:03 pm

I am writing a "CAN-Do" message log-reader and analysis helper program that can read in about 6 million messages in a couple of seconds. It is for Windows OS, at least XP and VISTA. It is an evolving work-in-progress.

As soon as I get it cleaned up a bit more, I am willing to post for download my most recent versoin of it, along with a test file or two, for interested parties.

As is, for your private, non-commercial use only.

If you can run my Sudoku Help-U-Solve ".exe" file (my source was Visual Basic 6) program, then you can probably run this CAN-Do program.

I will try to post some links here soon, maybe the Help-U-Solve download link tomorrow.
See SOC/GID-Meter and CAN-Do Info
2010 Prius, now for sale
2011 LEAF, sold in 2015
2018 Tesla Model 3
2014 Tesla S, Model 3 in 2019
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
To Sell: X-treme 5000Li EV motorcycle

GroundLoop
Posts: 1725
Joined: Mon Sep 13, 2010 9:31 pm

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 10:27 pm

Sounds very cool.
What input does it use? (A specific CAN adapter, or a text file input?)

User avatar
garygid
Gold Member
Posts: 12465
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 10:48 pm

It presently just reads our CAN-LOG file. However, I intend to make it gather and log data (from 3 USB virtual serial ports), and also show interesting values in real time.

Our typical 12-byte binary record (in hex):
30 40 23 61 D1 D2 D3 D4 D5 D6 FF FF

0x3040 = 12.064 seconds
0x2361 = 6 data bytes, ident 0x123 (0x6123 as low byte first)
[or, 0x61 0x23, high byte first)
then, the 6 data bytes and two FF bytes to make a 12-byte record.

Perhaps our "standard" record should include two more leading bytes for hours and minutes, perhaps as 0xHHMM for 0 to 255 hours in the first byte and 0 to 59 (one byte unsigned integer) minutes in the 2nd byte?

Note: Zipping these files will reduce their size quite a bit.
See SOC/GID-Meter and CAN-Do Info
2010 Prius, now for sale
2011 LEAF, sold in 2015
2018 Tesla Model 3
2014 Tesla S, Model 3 in 2019
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
To Sell: X-treme 5000Li EV motorcycle

User avatar
garygid
Gold Member
Posts: 12465
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 11:06 pm

We have 3 CAN-adapters, one for each CAN bus, that we have "programmed". They put out RS232 type serial data, via 3 Serial-to-USB adapters, to a UNIX logging program we made. I think it now logs only one CAN buss' data at a time, but we intend to make it log all 3 busses at once, probably into 3 time-stamped CAN-log files.

I intend to try to fold the same function into my CAN-Do (for Windows) program.

Others might have different adapters, and if they extract the messages to a serial RS232 type format, I can try to support several popular adapters.

The RS232 to USB (to virtual Comm Port under windows) adapters are only a few $ each.

What CAN readers are you successfully using, and what are the hardware and software interfaces?
See SOC/GID-Meter and CAN-Do Info
2010 Prius, now for sale
2011 LEAF, sold in 2015
2018 Tesla Model 3
2014 Tesla S, Model 3 in 2019
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
To Sell: X-treme 5000Li EV motorcycle

Return to “LEAF CANBus”