[WIP] AC Charging!!! Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Tell us about the project you do with the open inverter
Post Reply
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

[WIP] AC Charging!!! Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by J0hannes »

Well, looks like I'm in the business to shine some light to this project.

Maybe a word about myself first. I'm a mechanical engineer and a Suzuki nutter. The SJ Suzuki has been my 1st choise to rid me of my excess time and currency for over 25 years.

I've got a Suzuki SJ410k which has met a Samurai along its life and thus has Samurai running gear in.
This is a recreational Offroad vehicle for me but is also driven on pavement a day of driving is maybe 100-120km at worst (typical would be less than 50km and then a day of wheeling) So in that sense also a perfect candidate for a Leaf swap:)

Yes, this is a rusty shitbox, but I'm not bothered about it.
Image

The plan:

Phase I - Get the motor stack in and run Leaf battery on the pick up bed (if it fits). The idea is to skip motor coupling with transmission and go to TC with a drive shaft. Gearing should be ok
As this will be a road use car, I'll need to add a heater. Suzuki didn't make the heater core too big, so instead of shoehorning a PTC in place of it, I'm thinking about solving heater topic with a Volkswagen heater. I was looking at them from a online wrecker and they don't seem to cost a dick and an arm. This probably needs another coolant circulation pump?
I've already converted the retrofit powersteering to electrohydraulic, so brakes would be next. Vacuum pump should do the job.
It should be a first drive at the end of Phase I.

Phase II - Repack the battery so it can be squeezed lower, between the frame rails and majority of the mass in front of the rear axle to better weight distribution. Cleanup the rats nest of cable job that will definetly emerge along the way. I'll most likely eat my words, but for the time being I don't want to invest in a separate BMS, so Leaf LBC will be used and rewiring ahead.
I can't seem to get my head wrapped around the BMS topic. Why people seem to chose something else over the Leaf LBC even when using Leaf modules?
Inspection / MOT at the end of Phase II

Phase III - The winch --> This is a wild thought for the moment, but once I have 400V on the car, why not upgrade the winch motor from a 12v Amp chomper to something more sensible? A typical winch motor is 2-3Hp, so there should be at least some options for this. Hyundai HSG or something like that? Any Idea what power the electric AC compressor motors make?


Next on the list would be yanking all the ICE stuff out and get on with building.

I've ordered a full Leaf drive stack with a 30kWh battery, they should be arriving during next few weeks.
I'm now in the controller lookout phase.

At the moment my understanding is that Zombieverter would be the way to go if opting the Leaf full stack path. Any reason why not?
Attachments
IMG20220306084203.jpg
User avatar
johu
Site Admin
Posts: 5793
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 158 times
Been thanked: 1028 times
Contact:

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by johu »

Sounds actually quite simple to begin with. Numberplate and sparkling condensation suggests Norrland?

I'd always roll with OEM BMSes when feasible. Maybe this helps getting an idea of what's involved when re-arranging
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by J0hannes »

Norway is close but not quite. Finland :)

Thanks for the video, looks like quite a doable job to repack the battery once the time comes.

I placed an order for the Zombieverter board, enclosure and a 1000A IVT-S shunt.
I was wondering, is the shunt always needed with Zombieverter? I know that Damien said in one of his videos that the shunt is chosen to be used to standardize the system.

If I haven't missed something Leaf battery should have current measurement in it, so I was wondering whether it could be used and what might be the drawbacks if it would be used?
User avatar
johu
Site Admin
Posts: 5793
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 158 times
Been thanked: 1028 times
Contact:

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by johu »

Yes the Nissan BMS puts current on the CAN bus too. Not sure of Zombieverter supports decoding it yet but the code is available: https://github.com/jsphuebner/stm32-car ... eafbms.cpp
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Jacobsmess
Posts: 494
Joined: Thu Mar 02, 2023 1:30 pm
Location: Uk
Has thanked: 254 times
Been thanked: 66 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by Jacobsmess »

J0hannes wrote: Sun Nov 26, 2023 5:03 pm Norway is close but not quite. Finland :)

Thanks for the video, looks like quite a doable job to repack the battery once the time comes.

I placed an order for the Zombieverter board, enclosure and a 1000A IVT-S shunt.
I was wondering, is the shunt always needed with Zombieverter? I know that Damien said in one of his videos that the shunt is chosen to be used to standardize the system.

If I haven't missed something Leaf battery should have current measurement in it, so I was wondering whether it could be used and what might be the drawbacks if it would be used?
Moi!
This sounds like an exciting project!

I believe the zombie supports the BMW Sbox for current measuring as well as the IVT Shunt
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by J0hannes »

Some goodies came in yesterday!

Got the motor stack and battery in the shop now.
IMG20231128214002.jpeg
Looks like I got most of what I is needed. The heater? cable/connector seems to be the only thing missing. Anyone have a part number for this cable so I can find this easier online?
IMG20231128214437.jpeg
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by J0hannes »

Some things have proggressed.
I used the good info by Dala to make a rats nest of a battery sniffer to see how the 30kWh battery is doing.
Hello BMS.jpg
Well, as the Norwegian wreckers pre -dismantle pics showed 11/12 battery soh bars, I was expecting around 80% condition when purchasing this.
I still don't hve a deep enough understanding of the battery side to interpret whether this is in good condition or not, but maybe the community can shine some light on how to make sense of the Leaf Spy data :)
The leaf SM on battery says on the battery part that a maximum cell voltage ±33mV. I suppose that this 13mV seen in the LeafSpy schreenshots means that battery is good.
Battery health 01.jpg
Battery health 02.jpg
Looks like I didn't win in the PDM bingo and got a 3,6kW charger. Well, shouldn't be a too big of a bummer as this is a single phase charger and I'll be charging this with a 10A schuko plug charger anyways for most of the time.
PDM Bingo.jpg
I cracked open the PDM to remove the AC comp cable. A nice tool to use in the opening is a cheap knife
Crack it open.jpg
Later I read from the Leaf SM that you shouldn't use a metal tool to scrape the sealant as it can (will) cause shavings that can enter the PDM :o
Leaf PDM.jpg
AC compressor cable attaches to the battery input bus bars and there is a 30A fuse (400V), I wonder if there is anything limiting the max current which can be drawn here? See thoughts for phase 3 of this project ;)
AC Comp removal.jpg
I extracted the Leaf reduction gear input shaft as it is useless for me in any other purpose than adapter building. I had a Suzuki transmission main shaft with the splined output that was the first thing I thought of for the other part of the adapter build.
Adapter_01.jpg
The other day I remembered that I have laying somewhere in the parts bin this TC input gear that needs a dentist. This should be a more suitable blank to work on as it has the splined driveshaft flange end :)
Peeled teeth.jpg
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by J0hannes »

The other day I got things connected to the extent that I plugged the HV battery to see if the inverter would see the voltage rise during precharge (I did study the Leaf SM and to me it looks like the inverter voltage measurement is used during precharge to determine when to close main contactor.
Ready for motor spin.jpg
Inverter voltage goes up during precharge, so next I'll attempt some copy-paste-coding and see if I can get the Leaf BMS talking with zombie
Inverter voltage up.jpg
After some headscratching and pain with getting my modifications to compile, success?
Compile success.jpg
The Leaf inverter module in the Stm32-vcu code seems to send Leaf BMS messages to the CAN, I suppose these can be commented out, if the real thing is connected? :)
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by J0hannes »

An update in place: I'm in Github now :D
https://github.com/Romukeisari/Stm32-vcu-LeafLBC

This hackery is not working properly at the moment.
Contactors close and motor runs but EVSE is not charging.

Leaf LBC for current info and Leaf inverter voltage used for precharge info.
Is my train of thought correct if I mute the LBC simulating CAN messages Zombie sends to CAN if I have the actua LBC in same CAN as PDM and Inverter?

I've started to gather materials for motor/driveshaft adapter. Will use a 15mm aluminum plate as base and make a bearing mount in the middle.
User avatar
johu
Site Admin
Posts: 5793
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 158 times
Been thanked: 1028 times
Contact:

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by johu »

J0hannes wrote: Mon Apr 08, 2024 8:32 pm Is my train of thought correct if I mute the LBC simulating CAN messages Zombie sends to CAN if I have the actua LBC in same CAN as PDM and Inverter?
sounds correct to me
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by J0hannes »

johu wrote: Mon Apr 08, 2024 9:05 pmsounds correct to me
Thanks!

This gives me the courage to plow along and continue with the head banging.
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by J0hannes »

Headbanging continues

NEW ability unlocked, now I can CANtrace and decode with savvyCAN, this is really cool :D I use the AZE0 DBC by Dala

IF I'm quick, I can get the charger to click but no current. I may have found out the reason for no current, but at the moment don't fully understand what is happening.
image.png
The way I read this is that when the OBC wakes up, it's happy to output 3.3kW
image.png
This status shift realated to OBC bootup?
image.png
Zombie sends a charge power command, before there is AC voltage signal. Is this sensitive to the sequence of events.
image.png
Then there is AC status voltage, but nothing changes afterwards

Here's a CANdump of what I'm looking into at the moment. Here I have both the spoofing messages Zombie sends and the actual LeafLBC messages, but to me it looks like the OBC doesn't get upset because of all those LBC messages flying around. Thoughts and input are more than welcome :)

IF there would be a kind someone with a Zombieverter with Leaf stack and slow charging works for comparison a CANdump could be useful :) (of the process of plugging in the charger to a system which is OFF until the EVSE clicks and current flows)
Attachments
140424-1710_Startup_sequence_WITH_LEAF_BMS_Plug in during boot.txt
(2.93 MiB) Downloaded 7 times
royhen99
Posts: 211
Joined: Sun Feb 20, 2022 4:23 am
Location: N. Wiltshire. UK
Has thanked: 16 times
Been thanked: 101 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by royhen99 »

I have no experience with leaf PDM etc, but your code on github does not look up to date as it does not compile and has other errors.
From you CAN log the zombieverter is still sending data on 3 ids which may be causing the problems. I think this is because where you have declared/defined the variable to compare BMS type ( a bit confusing you are using shunt type parameter ) is fixed at compile time and is not code that is executed at run time.
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by J0hannes »

Good that you brought that up, I had some problems getting the code to push and now I managed to push some updates I'm working on to see if this would get it working (git also a very new thing to me :D)
Since the LBC measured current, I figured that I want the LBC to be listed as in the shunt type list. For me this seemed intuitive.
It'll be a while now before I'll have a chance to test this with my rig...
royhen99 wrote: Mon Apr 15, 2024 10:37 am I have no experience with leaf PDM etc, but your code on github does not look up to date as it does not compile and has other errors.
From you CAN log the zombieverter is still sending data on 3 ids which may be causing the problems. I think this is because where you have declared/defined the variable to compare BMS type ( a bit confusing you are using shunt type parameter ) is fixed at compile time and is not code that is executed at run time.
Which 3 ids are you referring to? Looks like I've missed something
royhen99
Posts: 211
Joined: Sun Feb 20, 2022 4:23 am
Location: N. Wiltshire. UK
Has thanked: 16 times
Been thanked: 101 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by royhen99 »

0x59E, 0x55B and 0x5BC. If you look at each id one at a time it's clear that most of the messages sent are the fixed values from leafinv.cpp.
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

Re: [WIP] Project Rising Sun: Suzuki SJ410k meets Leaf full stack

Post by J0hannes »

royhen99 wrote: Mon Apr 15, 2024 11:21 pm 0x59E, 0x55B and 0x5BC. If you look at each id one at a time it's clear that most of the messages sent are the fixed values from leafinv.cpp.
Oh yeah those, thanks for chicking this out and spotting them :) Like you mentioned, the declaration/definition of the variable to check shunt type was outside any called function, so it wouldn't have updated and thus my attempt to mute the messages didn't work.
J0hannes
Posts: 16
Joined: Sat Nov 11, 2023 10:29 am
Location: Finland
Has thanked: 2 times
Been thanked: 3 times

AC Charging works!!!

Post by J0hannes »

Woah, today I split the atom (well for me this felt like it :D)



My code botchery was only partially to be blamed for AC charging not working. While I've been beating myself why I'm unable to copy paste the work of others and tweak it so I'd get what I need, I also started to notice that I'm not alone with my troubles.
How come there are all these comments on this forum that AC charding does not work on Leaf PDM?
Bratitude has no AC charge
Then vin also has problems

What I have had working for quite a while now is contactor control by reading Leaf inverter voltage for precharging (just as Nissan does it, inverter is on when HV is on) and LBC current is visible on web ui --> current is read from LBC. Since I was getting more and more confident that my LBC "integration is not the problem, I began suspecting that there must be something not working properly with the part of Zombie code I have not touched.

I invested in LeafSpyPro to read the DTCs of the modules. Read the DTCs after I plugged in the EVSE and relays clicked and EVSE showed charging status.
CAN still showed that PDM is not happy and doesn't want to output anything
PDM_not_happy.jpg
Some DTCs that come back after clearing them, motor control DTC were related to the topic at and in a way yes...
Leafspy_DTC.jpg
Looked these up from Nissan SM
VC PDM fail-safe list.jpg
So it's understandable that PDM closes shop if it doesnd get all the info it needs.

It's really difficult to catch something that you are overlooking (because you make the assumption that this is proven working and there can't be any issues with it) I was close already, but then it finally hit me like an electric shock, while I was explaining to my friend how this is supposed to work and had the code and my latest can trace of system not working side by side. "You see, this part of the code is nice because it has quite a lot of comments that help to understand how this works. Like the PDM needs all these messages to operate and here you can see them being transmitted to CAN..."
Image
Can you spot the difference :lol:
CAN_trace_vs_code.jpg
I'll copy it here from NissanPDN.CPP for clarity and so that this is expressed somewhere on this forum posts so search can find this too.

Code: Select all

Info on running Leaf Gen 2,3 PDM
IDs required :
0x1D4 VCM (10ms)
0x1DB LBC (10ms)
0x1DC LBC (10ms)
0x1F2 VCM (10ms)
0x50B VCM (100ms)
0x55B LBC (100ms)
0x59E LBC (500ms)
0x5BC LBC (100ms)
So yes, you need all of the above CAN messages to be sent in order for Leaf PDM to function and to have AC charging working.
For anyone struggling with AC charging, check that you have these messages being sent

I will admit that, I was a little overzealous in muting the LCB spoof messages zombieverter sent and by mistake turned off needed message 50B.
But the real issue had been identified and fixed once over and got broken again as code has been modified, restructured and rewritten between releases.
Now I do not know what was the last published version of Zombie firmware that the AC charging on leaf PDM would have actually worked with Nissan original type 1 charge port. If I have understood correctly, using type 2 charging port needs some signaling going directly to Zombie?

Anyways, now the Leaf PDM AC charging can be fixed that it would work for ALL Zombieverter users :)
My GitHub should be up to date at the moment.

I got the Outlender EVSE connected to an energy consumption meter and that is a rowof digits I've been chasing here
Energy_flows.jpg
CAN also tells the truth
Charging_works.jpg
N00b here doesn't understand how a pull request works and when it would be appropriate to make one.
This is still in quite raw shape, but since I have your attention now, maybe I can get some comments on how to make this better.

This is likely a result of my code botching, but something weird is happening when I have the system run mode (T15 active) and shut it off. It seems to want to jump to charge mode, meaning contactors shut off but then immediately it tries to go to charge mode. I have not looked into this properly yet.
Post Reply