Stand alone OBC/PDModule EV system Can 2015 - SOLVED

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.
I am long overdue for an update. I solved this problem a week or so back after two years of effort.
It is not quite as easy as some have suggested and there is some important details to be aware of.
I am staging a video of exactly how it works and what you need to do to make it work completely on it's own with no VCM either factory or an Open Source Inverter just a few connections and canbus messages from an arduino due. Stay tuned I will post the details shortly. Sorry for not getting it out with this message but I have been felling guilty about those of you that have been pulling your hair out on this one. I will be posting diagrams and code. Stay tuned I will post the details shortly.
Happy days, thanks to all of you that have provided advice and support.
Peter
 
Hello,

I am currently working on trying to control a Gen 1 (ZE0) 2012 Nissan Leaf OBC through CAN messages. Is there a guide for Gen 1 chargers available anywhere, or somebody who's successfully controlled it?
 
Finally wrapped the Solution up, below are links to my GITHUB documentation, arduino due source code and videos.

Enjoy.
The demo video Ad free on Google. https://photos.app.goo.gl/E4M1p5wLaGtFn5GN7
Check out the videos.MD file on GITHUB for more videos on this build.

The GitHub repository, not beautiful but it is what I have to share at this time.
Look in the OBC folder for this project. https://github.com/49thdiver/EV-Projects

Thanks to everyone for the help and moral support, Good luck with your projects.

Peter
 
Hi Peter
This is amazing work, you did well to stick at it for two years. I hope you don't mind if I try to pick your brains.
I am trying to get my standalone Gen1 OBC to charge my HV battery and have been having some difficulty. I don't know for sure if your code will work with a Gen1 but I think it is worth giving it a try.
I have a Due and several CAnBUS shields so I had a go at installing your code on the Due and it loaded OK. The thing is I'm not too sure how to load the libraries for my shields. I'm pretty rubbish at coding so mostly end up copying others.
My CANBus shields are from Sparkfun, DIYMore and Seedstudio, but none of them spat out any CAN. if you can offer any advice I'd appreciate it.

Thanks
 
Albro, not sure how much success you will have with the Gen1, I am sure it is similar but it is clearly different hardware. That said give it a try.

The beauty of using the DUE is that it has an on board CAN controller and my software works with it.
All you need to use the can controller on the due is the Can drivers TJA1050, SN65HVD230 or the MCP2551.
All of these chips cost around a$1 and are easily added to a proto shield for your DUE.
You will want to use you other shields on an UNO or similar as a can bus monitor, that will enable you to monitor the can messages coming from the GEN1 charger as well as the messages you are sending.

A two way device called a bridge is also handy to have. It consists of two can interfaces that would enable you to see the messages coming from the charger in a separate communication stream from the messages from the due, that way you can see the interactions. There are a number of devices out there I have been using the one from Muxan and one from toggle bit.

All of this said you can buy a gen2 charger from an auto wrecker for not much money and it would short cut you to success. If I accounted for all the time and money I spent on this I could own a good part of a Tesla by now. :eek:

Good luck with your project, be safe.
 
Thanks for your reply Peter
The reason I am persisting (for now) with the Gen 1 charger is I have one, in fact I have all the electronics from a Gen 1 Leaf so I am trying to tie the BMS, charger, DC-DC converter and Inverter together to keep things neat. It would be nice to come up with a complete solution for using all this kit as the cars are fairly common and parts for them.
I have the BMS connected and the battery junction box (contactor unit) and the DC-DC working so with one switch the HV connects to the PDM and the 12V battery starts to charge.
I can't confirm if the BMS is seeing the cells properly yet but hope to sort that out later.

As for the Shield I have seen some claim they got it to work on a Due but I guess I would need to change your code to make it work for me and that is where I struggle.
I have a few MCP2515 adapters but they are the type that are suitable for use with an UNO or NANO so I didn't think they would work. These are the ones. https://amzn.to/37EHzO7

I have some of the bare board board type on order, https://amzn.to/36COnLK and https://amzn.to/37xakws
Are these the ones I need? If so will the code need anything changed to work with these?

Thanks again
 
Yes those little can boards should work, I have some of those but have not had a chance to try them yet.
My code is written for the DUE and if you just connect those drivers and it will work with a Gen 2 charger.
Note if you have an entire gen1 leaf for parts you really only need to connect the VCM and the some of the other control modules and the whole system will work.
I have done this in a Gen 2 complete conversion and it work perfectly with no need for any external controller.
I developed due hardware and software to facilitate using the charger in a factory built 2002 toyota Rav4EV with out any of the other hardware.
Anyway good luck keep me posted.
 
49thdiver said:
Yes those little can boards should work, I have some of those but have not had a chance to try them yet.
My code is written for the DUE and if you just connect those drivers and it will work with a Gen 2 charger.
Note if you have an entire gen1 leaf for parts you really only need to connect the VCM and the some of the other control modules and the whole system will work.
I have done this in a Gen 2 complete conversion and it work perfectly with no need for any external controller.
I developed due hardware and software to facilitate using the charger in a factory built 2002 toyota Rav4EV with out any of the other hardware.
Anyway good luck keep me posted.
Thanks for getting back.
When I stripped the car I should have allowed for refitting the VCM etc as a last resort but at the time I didn't think it would be possible and I cut a lot of the loom. I don't know if I could refit everything now.
When the CAN boards arrive I'll let you know how it goes. It would be great if it just works on both the Gen2 and the Gen1
 
Hi Peter
I'm still waiting for bits to arrive so I thought I'd have a go at hashing together a transceiver by hacking the crystal and MCP2515 chip out of a MCP2515 module similar to this one https://amzn.to/3LiFxSt but I'm not seeing any CAN from the DUE. The module has an A1050/C chip on it which I thought I had connected correctly but maybe I got something wrong.
If I had got it right would I just connect the DUE CANtx and CANrx to the Tx and Rx input of the A1050 chip?
Would I need to make changes to the sketch to tell the DUE to send CAN from these pins.

Thanks for your help.
 
That is all you need to do.
No change to code required. That should work as you have described it.
You may need to bring make sure the termination resistor is connected.

A scope would be handy to check the signal, what are you using to read the candata do you know that it works.

Those 2515 boards work well on uno's for monitoring, if you had two you can set them up to talk to each other to see if they are working you can also set one up as a loop.
The can speed is 500K make sure what you are monitoring with is running at the same speed.
 
I have a 2515 board soldered to a Nano which I use to check CAN from the charger and BMS. It is already set to 500kbs and works well so if the Due was transmitting I should be able to see it. I suspect my little mod is less than optimal so I'll just wait for the suitable cards to arrive. It is hard to get them locally so it might take a week or two.
If I figure out how to I'll post some photos. ;)
 
If I figure out how to I'll post some photos.

Upload them to an image hosting site like Imgur, then link them to display here by copying the appropriate HTML code at the image site, pasting it here, then using the "Img" tag. Or, if you just post the link here, I or one of the other Mods will do the last part for you.
 
Thanks, I'll do that.


Right after checking if the GEN 1 charger will kick into life from your code.
It turns out I'm a numpty and had forgotten I had messed about with your code a few days ago. It turns out my hash up of the MCP2515 module had worked after all and after reloading your original code I am getting CAN from the DUE now. :D

I'll report back after testing on the charger.
 
Nice I copied this image a few days back for a reference to make sure you had the right can port as there is a second can port on pins 53 & 67 it's unlikely you would have connected to them as it seems to be a well keep secret at Arduino and infact some documentations list pin 66 as the CANRX1

etherdue_pins_small.png


Anyway this is good information if you want to run two Can ports to use it as a bridge.

Send me a copy of the CAN code you are seeing, I assume you have compared the Kvaser data base for the gen1 and gen2 to look for similarities and differences.

Looking forward to some positive results, listen for the relay click in when you start the arduino with power and J1772 connections going to the charger. When I first new I was getting close to getting it to work the relay would click on and off. I finally discovered the missing command and thats when it started working properly.

Good luck
 
Here are a few photos of the Due in action

My hack job at a MCP2515 module
mKOY4dO.jpg


Connected to the Due
ZgAN3L1.jpg


The CAN showing on Canhacker
mRZT5Pb.jpg



I tried to get the charger working last night but no joy. I think I have all the links between the charger and the PDM made but I probably need to emulate the PDM signals which normally come from the VCM as I didn't hear any relays clicking.
This may not be quick. :cry:
 
If you hook the can hacker up to the charger/pdm, when you plug and unplug the J1772 you should see can message x679 coming from the charger to the VCM to tell the VCM its just been plugged in and again when you unplug it. That will tell you that your connections to the charger are good. The charger also broadcasts x390 and x393 every 100ms when the charger is on. I imagine the Gen1 charger has similar functionality if not the same commands.
 
I've been very busy the last few days and haven't got back to this but I think I'm missing some connections to the PDM so will go through all that and have another go tomorow.
 
Back
Top