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

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 11:20 pm

I really liked my Intrepid Systems "ValueCAN" USB adapter, since it could handle a fully loaded 1Mbps bus, but it died on me. This is the second one that died this way, so I'm not inclined to buy another. (The hardware is likely fine, but it can no longer get out of the PIC bootloader, as if it lost its programming.) Doesn't seem to be supported any more. The bundled software is pretty nice, and I wrote my own Linux library for it. If only they were cheaper.

I have an Acacetus CAN-uVCCM, which is a fine isolated RS-232 adapter with a versatile serial protocol. Its fatal flaw is that it maxes out at 57600bps RS-232, which is nearly useless on today's system. Still, if you set up the filters appropriately or just use it as a test sender, it works well.

I have a pretty old (2004) Lawicel CAN232 adapter. This one works reliably, and has the unique ability to run at 230kbps on the serial side. This is the one I'm using now, and the serial format is well-documented:
http://www.can232.com/downloads.htm
In combination with an FTDI USB-RS232 adapter that can do 230kbps, it works great.

I see that Lawicel now sells a CANUSB, which has an integrated USB chip for higher bitrates.

I have an Atmel ATDVK90CAN1 kit somewhere and a Proconx.com XNUT-105 CAN board for embedded stuff. If we can get some clarity on the SOC messages, I'd probably build a mobile display out of that.

So this is all old gear from 2003-2005. What are the cool kids using these days? I imagine there's an Arduino CAN variant by now?

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

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 11:26 pm

garygid wrote: 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?
I wouldn't do it. The Lawicel format just uses a 16-bit millisecond count that wraps to zero every 60 seconds. That works fine, and stays compact and predictable for arbitrary length log files.

Something to consider is a sential or sync value somewhere.. if your parser gets out of sync with your data, can it ever re-sync?

I haven't seen anything other than 11-bit Identifier standard messages on the two Leaf busses (CAN & EV CAN) so far, but the Lawicel format allows for those.

I used to put a lot of effort into filtering and distilling the logs down into something manageable, but modern machines make that a bit pointless.. even my crude C code can crunch through a 40MB log in seconds.

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

Re: LEAF CANbus decoding. (Open discussion)

Wed Jun 01, 2011 11:55 pm

When I do a remote (telematic) poll for status, the EV CAN bus wakes up and carries traffic for 6.4 seconds.

There are only ~3,526 non-repeat messages in that burst.
(I mean messages that are not identical to their previous data.)

I captured one at 50% charge, and one after a 100% charge.

This brought to light message 5BC as being different between states.
Ignoring the cyclic bytes (D6,D7,D8), check out the first two bytes (D1 D2).
I see them increasing during charge, and decreasing during drive.

There are other interesting things happening in that message during drive, but just the two leading bytes stand out in their behavior.

At ~50% charge: 0x2903
At 100% charge: 0x4643

Values change very slowly in the tail end of charge too.

Not all values are represented. The second byte seems to have only four values, so it could be a 10bit value adjacent to something unrelated.

If we look at it that way, as a 10-bit value, then a 50% charge is around 0xA4 and a 100% charge tops out at 0x119.

I did catch one instance of the value INCREASING one step while driving, which may be regen. It's rare.
ID 0x5BC... This one is worth looking at more.

User avatar
TomT
Posts: 10642
Joined: Sun Aug 08, 2010 12:09 pm
Delivery Date: 01 Mar 2011
Leaf Number: 000360
Location: California, now Georgia
Contact: Website

Re: LEAF CANbus decoding. (Open discussion)

Thu Jun 02, 2011 8:57 am

One thought that has been nagging me:

We all know that the SOC values represented by the bars have changed with the new VCM firmware, particularly at the bottom end. The question is, have the actual SOC values on the buss changed or has the way the dash interprets those values changed? If it is the latter, it is no big deal but if it is the former then it has large implications for a standalone SOC meter since the calibration of said meter might then change every time Nissan does a VCM firmware update...

Thoughts on this?
Leaf SL 2011 to 2016, Volt Premier 2016 to 2019, and now:
2019 Model 3; LR, RWD, FSD, 19" Sport Wheels, silver/black; built 3/17/19, delivered 3/29/19.

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

Re: LEAF CANbus decoding. (Open discussion)

Thu Jun 02, 2011 9:15 am

It depends on where the SOC-to-Bars "interpretation" happens.

I have to think/hope that the true SOC (or maybe just Ah & Volts) is on the data bus somewhere, but it's possible that this data is totally retained in the OBC and only digested step-wise information is placed on the bus for modules to use.

The hint would be that the dash on the car and the dash on Carwings agree regarding the number of bars. If they were computed separately from raw SOC, you might see discrepancies on some cars that have or don't-have the update, right? So there might be both on the bus.

The ECO screen seems to have more resolution in the "power consumed" display than the stupid bubbles on the dash, so that's promising.

Another possibility is that detailed SOC and real-time performance are only transmitted when requested by the CONSULT tool. This means we won't see them by passive monitoring, but would have to spoof the same messages CONSULT sends to delve into the battery state and wear information. Given how few messages are on the bus, this starts to look pretty likely.

Some quality time with a CONSULT-III+ and a bus analyzer would be really useful. If anyone knows where I could rent one, that would be awesome.

User avatar
TomT
Posts: 10642
Joined: Sun Aug 08, 2010 12:09 pm
Delivery Date: 01 Mar 2011
Leaf Number: 000360
Location: California, now Georgia
Contact: Website

Re: LEAF CANbus decoding. (Open discussion)

Thu Jun 02, 2011 9:18 am

I have a lot of driving to do today and will be coming home pretty much empty, so I'll grab some data points through the day and report back on what I find.
GroundLoop wrote: The hint would be that the dash on the car and the dash on Carwings agree regarding the number of bars. If they were computed separately from raw SOC, you might see discrepancies on some cars that have or don't-have the update, right?
Leaf SL 2011 to 2016, Volt Premier 2016 to 2019, and now:
2019 Model 3; LR, RWD, FSD, 19" Sport Wheels, silver/black; built 3/17/19, delivered 3/29/19.

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)

Thu Jun 02, 2011 10:11 am

I've posted about all this in other threads.

The update changed the way things are calculated a lot.

Old way: LBC calculated bars
New way: the VCM calculates the bars.

edit: corrected TLAs for nissan's convention.
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)

Thu Jun 02, 2011 10:33 am

Oooooo... check this out.. Arduino CANBus shield, with microSD:
http://www.skpang.co.uk/catalog/product ... cts_id=706

And cheap:
http://www.sparkfun.com/products/10039
http://code.google.com/p/skpang/

I have one on the way. (Note that you can't use the nice molded pre-made J1962 from SparkFun to connect to anything but primary CAN.)

This shield, an Arduino and a Serial LCD display seem like the lowest-cost DIY dash display.
Cheers!

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

Re: LEAF CANbus decoding. (Open discussion)

Thu Jun 02, 2011 11:03 am

I think we have a winner for SOC in the top 10 bits from Identifier 0x5BC:

A short drive with stops:
Image

A charge from 20 to 100%:
Image
Last edited by GroundLoop on Thu Jun 02, 2011 4:19 pm, edited 1 time in total.

jimcmorr
Posts: 398
Joined: Tue Jan 11, 2011 8:41 am
Delivery Date: 02 Apr 2012
Leaf Number: 018747
Location: GA

Re: LEAF CANbus decoding. (Open discussion)

Thu Jun 02, 2011 11:18 am

I am truely impressed! Do the flat spots in the top plot coincide with slow driving or complete stops?

Good job!
Jim M
res: 25APR10 #612239F1 Glacier Pearl SV
Ordered: 03Mar12 Cayenne Red SL
VIN: 18747 - pickup: Mon 2Apr12
22Apr14: over 20K mi / lost 1 capacity bar Mar 2014
It isn't 100% electric if you have to put gas in it.

Return to “LEAF CANBus”