I made a transparent CAN bus bridge with logging, requesting input

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
jake14mw said:
For those of us Leaf owners that don't understand a word of any of this, should this be of interest to us?

Not quite yet. We're talking about replacing the on-board charger (OBC, thing that converts mains electricity to the battery voltage, slow-charging the battery off of your home mains or J1772/Type 2 charging points). If this can be generalized, i.e. if we can find a way to retrofit pretty much any charger to the Leaf, this can open up a lot of opportunities. In this case we're just talking about replacing a broken charger with an aftermarket one, but the same procedure could be used to e.g. add three-phase charging to the Leaf or even retrofitting CCS and higher power charging.
 
mux said:
...

So I expect the OBC to be reasonably easily swappable. The main annoyance is having to refill the coolant loop.

In order to use a non-OEM OBC, you will have to spoof the original OBC. The OBC has to issue a wakeup message on CAN and do some chatting to the VCM to let it enable the relays. I don't know exactly what it says, but it will no doubt be synthesizable with my hardware. If you are seriously interested and willing to share your findings, I can send you a CAN bridge to play with.

I am very interested in pursuing this and will share all info I find.
 
mux said:
Not quite yet. We're talking about replacing the on-board charger (OBC, thing that converts mains electricity to the battery voltage, slow-charging the battery off of your home mains or J1772/Type 2 charging points). If this can be generalized, i.e. if we can find a way to retrofit pretty much any charger to the Leaf, this can open up a lot of opportunities. In this case we're just talking about replacing a broken charger with an aftermarket one, but the same procedure could be used to e.g. add three-phase charging to the Leaf or even retrofitting CCS and higher power charging.

That is an excellent summary! The ability to second source expensive parts leads to lower cost options. I would like to replace the 3.3kW OBC with a 5 or 6kW unit. Maybe something larger if I can add cables to increase ampacity to and from the charger.
 
@mux Any luck on figuring out the 80% charging with your CAN bus bridge? I'm lucky enough to have a 2013 so I have the 80% charge option built-in, but this is likely the most requested feature on the forums for 2014 and newer LEAF owners.
 
alozzy said:
@mux Any luck on figuring out the 80% charging with your CAN bus bridge? I'm lucky enough to have a 2013 so I have the 80% charge option built-in, but this is likely the most requested feature on the forums for 2014 and newer LEAF owners.

Darnit, I just finished editing a video with feature requests for my startup. Completely forgot to put this on the list. I have not started work on this yet, but I will attempt to implement configurable charge cutoff.
 
Since SOC roughly corresponds to no-load voltage, have you considered doing a cutoff by just the pack voltage while charging? It might not hit the exact percentage desired, but having multiple options would still be great.
 
That's not necessary; I'd need to be on the CAN bus anyway to issue wake/sleep commands to make this work, and the battery already sends GID information on the bus. So it's pretty easy to set a cutoff based on GIDs, kWh, time, whatever you like.

Edit: and obviously, if for whatever reason you'd like to set a cutoff based on no-load voltage, that's possible too. That information is on the bus too.
 
mux said:
if we can find a way to retrofit pretty much any charger to the Leaf, this can open up a lot of opportunities. In this case we're just talking about replacing a broken charger with an aftermarket one, but the same procedure could be used to e.g. add three-phase charging to the Leaf or even retrofitting CCS and higher power charging.

As an example a MPPT functional charge controller for direct DC solar charging? Might be a better "port" than the CHAdeMO? Any possibiities?
 
An MPPT solar charger... how big a solar panel? Because there's quite a lot of miscellaneous power drain in the car while it's charging. You kind of want the charging power to be quite high to compensate for a few dozen CAN devices waking up, the DC/DC converter working, the VCM and TCU being fully on and the contactors drawing power. Altogether it's something like 60W of drain just to keep the car on while charging.

So that would only work with a decent-sized solar panel in daylight. That being said, sure, literally any voltage-compatible charging device regardless of source should be able to be retrofitted.
 
I have two solar systems ~ 3900 and 2800 watts. modifying to combining in a high voltage configuration is not too much of a problem (500 VDC+). That would allow me to use my 2012 Leaf in a daily charge mode and have enough energy for nighttime comfort and keep modest appliances going - at least during sunny days. I'd get up to about 20 kWh on a good sunny day. A combo level II (with 7 kw) with an included DC charge controller that accepts a SB50 Anderson would be just the ticket (maybe?).
 
Hi Mux,

Can multiple can bus bridges be time synchronized? The idea being you could monitor the OBC, LBC and VCM at the same time and record them all to determine what is needed for an aftermarket OBC.

I'm trying to get the can bus command protocol from the Renesas R5F71424FP microcontroller in the OBC. But it is new territory for me and is going very slowly. Looks like the best idea may be to unsolder the chip from the board. I'm trying to find a programmer for the chip (that can read the program out) and not having much luck.
 
Hm, that's a good idea actually. Yeah, they certainly could be with some external synchronization source (probably via the serial port). They use crystals for their on-board clock, so during a logging session you should only need to sync once and then just let them freerun, they won't start deviating significantly until many hours of logging.

I'll look into adding that to the firmware. I've actually had quite a few problems with the firmware as of late, and I've been really busy doing all kinds of mechanical work for muxsan, so progress on the public-facing part of the can bridge has been slow.
 
Hi Mux,

The Renesas R5F71424FP mcu is locked down against serial extraction. Using a parallel programmer, about $1900USD plus shipping, I could get the binary extracted. Kind of defeats the idea of a low cost replacement charger...

I did find two Chinese companies that will change the CAN bus messages if they are given a CAN bus protocol. The 6.6kW chargers are liquid cooled and "should" fit under the hood of a 2011/2012 Leaf for about $1067USD for the charger plus the extras to install. Since it ties into the inverter wiring there are no concerns regarding charge rate.

So it is back to decoding the charger CAN bus as the lower cost option. Do you know how to intercept the battery LBC without removing the battery pack? If the the OBC, LBC, VCM and EV CAN bus are monitored simultaneously then the OBC CAN messages/protocol can be pulled out.

Adding Chademo charging will require an additional CAN port and more work. Or testing to check if the Chademo messages conflict with the existing EV CAN bus IDs. Why did Nissan add a separate CAN between the OBC and the Chademo charge connector?
 
Then there's very little use - just use Brusa chargers instead. Way cheaper and you can triple them up to go three phase.

The easiest way to intercept battery messages is right at the VCM, because nothing else uses the unique battery messages. Only the computed values sent out by the VCM. So just interrupt the CAN bus behind the glove box at the VCM connector and you're golden.

If you really want to be sure to only get the LBC messages, you don't need to remove the battery pack. Just put the car on a bridge or drive it onto some wooden beams if you don't have a bridge at your disposal, disconnect the 12V, go under the car and remove the second belly panel. There you have full access to the battery signal connector, use the pinout in the service manual to tap the CAN bus. If you don't feel secure dangling electronics under the car, extend the wires (try to keep CANH/CANL equal length) and run them into the car through one of the many rubber cable glands.
 
mux said:
Then there's very little use - just use Brusa chargers instead. Way cheaper and you can triple them up to go three phase.
The 3.3kW BRUSA NLG513-U1-01A-A01 Battery Charger costs $3591USD plus the extras and the 6.5kW single phase BRUSA NLG664 22kW Battery Charger costs $6239USD. My understanding is the Brusa chargers work as secondary to the OBC and will not work with the Leaf CAN bus without the OBC.

The easiest way to intercept battery messages is right at the VCM, because nothing else uses the unique battery messages. Only the computed values sent out by the VCM. So just interrupt the CAN bus behind the glove box at the VCM connector and you're golden.
I did not realize the VCM was the only device listening to the LBC. Seems like the LBC messages are not needed. If you already know all the LBC message IDs, they can be filtered out.

If you really want to be sure to only get the LBC messages, you don't need to remove the battery pack. Just put the car on a bridge or drive it onto some wooden beams if you don't have a bridge at your disposal, disconnect the 12V, go under the car and remove the second belly panel. There you have full access to the battery signal connector, use the pinout in the service manual to tap the CAN bus. If you don't feel secure dangling electronics under the car, extend the wires (try to keep CANH/CANL equal length) and run them into the car through one of the many rubber cable glands.
This will be the backup plan if needed.

Thanks,
Rex
 
Ah of course I should be a bit clearer... I say Brusa, I mean imitation cheap Chinese Brusa clones :) They're about 400 bucks in 100-off, 800ish single unit. You can build an 11kW AC charger for 1500 bucks with those, or 22kW for about 2500. Not quite as cheap as DC quick charging with a CCS retrofit, but close.
 
mux said:
You can build an 11kW AC charger for 1500 bucks with those, or 22kW for about 2500. Not quite as cheap as DC quick charging with a CCS retrofit, but close.
Do you have the dimensions or a link to them? Are they CAN bus controlled and water-cooled?
 
I can't vouch for them personally, but I know two companies that have used/are about to use QNBBM's chargers, e.g. https://www.aliexpress.com/wholesale?catId=0&initiative_id=AS_20181013103444&SearchText=3.3kw+charger

But generally, you have to just look around. They're mostly on alibaba, aliexpress and ebay. Generally if you look for 3.3kw charger or 6.6kw charger you'll find the brusa replacements. And yes, they are generally watercooled and either CAN-controllable or have something that is fairly easy to integrate otherwise. Note that the original Brusas interfere with the Leaf CAN bus because it overlaps some CAN IDs, so you do have to keep that in mind.
 
https://www.youtube.com/watch?v=hLJefVNS8JA

Alright, sorry for the delay since the last update on this project, contrary to my initial plan I actually found somebody to help me with firmware locally and figured out the last bugs and performance issues with this project. It's done now! Sorry RkEvHopeful for not getting back to you sooner, you're still getting your board very soon!

So, this is essentially an eavesdropping tool for CAN buses. Cut any CAN bus in twain, plug one end into one port and the other into the other port and this board will transparently repeat CAN messages back and forth - while at the same time logging every single CAN message to an isolated serial port. This allows for much more detailed CAN bus reverse engineering than has been done so far on this forum as well as active modification of pretty much every behavior of any car.

The current feature set:
- Supports 500kHz CAN only
- Supports any message rate - tested up to approx. 700msgs/s but can deal with a saturated bus in unit tests.
- Consumes approx. 35mA @ 12V, board is 50x30mm
- Isolated serial port via JST XH 4-pin connector at 921600 baud
- replicates serial port on-board via a 6-pin expansion header (will likely get an ESP32 expansion board soon)
- Firmware can be updated via USB, no drivers or programmers required

I will be selling these boards via a yet to be set up web shop under the Muxsan brand, in the meantime I'm not quite sure what to do, I might temporarily sell them on my Tindie store. The board for now will NOT be open source as such, but if you're willing to help with firmware development I'm happy to share. The main reason for this is that we're using this board for our Leaf conversions and are still working out the details of where to put the IP and how to recoup development costs.
 
Back
Top