Sponsor Banner Go Fast Bits Castrol Edge Super Cheap Auto Haltech Bridgestone RE003 Ryobi Tools Century Batteries WD-40

Announcement

Collapse
No announcement yet.

Dala's Leaf buildthread (2015 Nissan Leaf)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dala
    replied
    Originally posted by Kaktus View Post
    Hi Dala, this is very fascinating it has to be said, even though it is mostly gibberish to me at the moment.... There's a crowd in my neighbouring town who have recently started giving week-long hands-on EV conversation classes that I'm considering signing up for next year where they show in detail how to go about converting an ICE car to EV.
    Highly recommend it! I actually held a guest lecture at the local university, talked about lithium batteries!

    So, here's something mechanical for a change. I noticed that this car had never had any proper periodic maintenance done on it. The service records in the book were empty! Let's remedy this.

    The only thing that is in the periodic maintenance intervals are brake fluid flushes and cabin filter replacements. That's it! Reading the service recommendations is a real eye opener on how cheap it is to operate an EV.

    I decided to upgrade the OEM DOT3 fluid to a DOT5.1 brakefluid.


    Bleeding the brakes on the Leaf is exactly the same as on any caliper equipped car. I flushed 1000ml brake fluid thru the system to guarantee that no DOT3 fluid would be left.


    Now I get to make the first stamp in the service book Since the weather is getting colder, I finished the job by putting on the winter tyres.

    Leave a comment:


  • Kaktus
    replied
    Hi Dala, this is very fascinating it has to be said, even though it is mostly gibberish to me at the moment.... There's a crowd in my neighbouring town who have recently started giving week-long hands-on EV conversation classes that I'm considering signing up for next year where they show in detail how to go about converting an ICE car to EV. This would be for covering all the basics, they also seemingly have follow-on courses for digging into CAN and all sorts of other black magic that comes with EV technology, so would definitely be both interesting and no doubt a steep learning curve for me.

    Leave a comment:


  • Dala
    replied
    After analyzing the data with XTM, we found out that the 2015 Leaf behaves very differently compared to the 2011 model. The 0x5BC message is sent with 100ms instead of 500ms, and internally it has two multiplexes that decides the content inside it.

    So to get the chargebars to move, you need to modify 0x5BC frame[2] bits4-7. The multiplex signal is inside frame[4] bits 0-3, which alternates between DEC 8/9. Here is a code snippet I used to test this out


    The end result can be seen here

    Leave a comment:


  • Dala
    replied
    I've almost cracked the final messages that I need to perfect the bruteforce swap. I thought it would be good to share this information how to reverse engineer CAN messages. There are many ways to do this, but here is my workflow.

    I started on the fine work already done by the community. There is a bunch of Nissan CAN message decodings already done, found in an excel here: https://docs.google.com/spreadsheets...uwg/edit#gid=0

    However, most of that information is related to early 2011-2012 ZE0 Leafs. So not all the information was applicable. Also keeping data in an excel document has its limits. So I downloaded Kvaser Database Editor 3, and started to create a proper CAN database that can be interpreted by engineering tools. Here is what that file looks like.


    Once the data is in a good format, you can more easily start to edit, format, test, playback logs etc. To analyze a CAN log-file, the workflow would be
    1.Drive the car, capture CAN data with CANrunner running on a laptop (EV-CAN)
    2.Get back in front of a computer, play back CAN data with CANrunner (on a virtual CAN channel)
    3.Open XTM, import the database.dbc file you made
    4.Start sniffing the virtual CAN channel, trend values, monitor etc.

    Here is what XTM looks like


    As you can see, decoding CAN is not some black art, only lots of manual work staring at numbers and writing down changes overtime

    Originally posted by cubic_nz View Post
    Are you sure you need to add another 120 Ohm resistor when you connect to the OBD2 port? Given the CAN system only requires a resistor at each end, and the network is complete without your connection, surely you are adding a third resistor and dropping the resistance between the lines to 40 Ohms, rather than the intended 60 Ohms?

    Like you said, CAN is quite fault tolerant, I've forgotten to add a second resistor on occasion and not seen any detrimental effect, so it wouldn't surprise me if adding a third was also not a big problem.
    Yes, this is what all OBD2 dongles do. The CAN bus is not wired in series, so you don't affect any other nodes by adding (or lacking) a 120Ohm resistor.

    Leave a comment:


  • cubic_nz
    replied
    Are you sure you need to add another 120 Ohm resistor when you connect to the OBD2 port? Given the CAN system only requires a resistor at each end, and the network is complete without your connection, surely you are adding a third resistor and dropping the resistance between the lines to 40 Ohms, rather than the intended 60 Ohms?

    Like you said, CAN is quite fault tolerant, I've forgotten to add a second resistor on occasion and not seen any detrimental effect, so it wouldn't surprise me if adding a third was also not a big problem.

    Leave a comment:


  • Dala
    replied
    I've been busy stomping bugs, here's a status update

    Muxsan solved the CAN corruption issue that could occur every 6-12h. This was problematic, since it could cancel the charging session. Imagine setting your car to charge overnight and waking up to an almost empty battery! The fix supplied from Muxsan seems to work very well, so I am happy

    Another bug I noticed, was the Low Battery Warning popup. It triggers at the correct place (>30%SOC), but since the SOC is estimated with a voltage lookup table, it was not very stable. During heavy acceleration, it could trigger the LBW, and upon releasing the pedal, the LBW faded away.

    To solve this, I now put in the lowest of effort, an average function!


    The code snippet at the top saves the battery voltage (once every 500ms), and makes an average once 10 samples have been read. This should remove the heavy swings in the SOC-estimation. Let's see if I need something more elegant, but I like to keep things simple.

    Speaking of simple, I just got a shipment of EVs Enhanced HV Battery Translator. These can do clean upgrades, for swapping in 30kWh packs into 2013-2015 Nissan Leafs. Essentially making my bruteforce method obsolete for this vintage of Leafs (and that is a really good thing!).


    I've been putting off touching the 40kWh pack, since Muxsan has gotten 40kWh packs to natively boot in a 24kWh Leaf. If it were possible to do a clean 40kWh swap with only the CAN-bridge, I would much prefer that compared to another 12h+ session of bruteforcing an upgrade.

    Originally posted by Kaktus View Post
    That's a great fix, Dala!

    Btw, I read recently an article about charging to EV batteries to only 60% most times (when full charge isn't needed anyway) in order to increase the life expectancy of the batteries. Seemingly the recommendation has been to only charge to 80% most of the time, but there is now a school of thought that one should only charge to 60% (obviously provided that gives sufficient range for the driving you normally do).

    Would you have any thoughts on that? I'm only asking out of curiosity as I wouldn't have a clue about this subject....
    What you heard is correct. The Nissan already has a buffer reserved up top. If you charge it up to "100%", it's actually 94%. This is to increase the lifetime of the cells. You can ofcourse try to manually keep the SOC between 40-60% to increase lifetime even more, but on a car with just ~200km of range, IMO it's not really worth it. By the time the cells become degraded enough, it's just to buy and plop in a new upgraded battery and make the car into a 300-400km car instead

    Leave a comment:


  • Kaktus
    replied
    That's a great fix, Dala!

    Btw, I read recently an article about charging to EV batteries to only 60% most times (when full charge isn't needed anyway) in order to increase the life expectancy of the batteries. Seemingly the recommendation has been to only charge to 80% most of the time, but there is now a school of thought that one should only charge to 60% (obviously provided that gives sufficient range for the driving you normally do).

    Would you have any thoughts on that? I'm only asking out of curiosity as I wouldn't have a clue about this subject....

    Leave a comment:


  • Dala
    replied
    I've got good progress on the instrumentation correction!

    24kWh has ~280 gids full, 30kWh has ~360 gids full. After modifying the 0x5BC CAN message, and adding 70gids, the 24/30kWh bruteforce battery is atleast doing two things correctly now!


    As you can see, it now reports remaining km even when all the charge bars have disappeared. Before it just went '---'! Also it doesn't trigger Low Battery Warning(LBW) anymore at 16%, it instead triggers close to actual LBW!

    Now only two things left to fix, the dash SOC is still showing wrong % values. Also the chargebars disappear way too soon. But progress is progress!

    Leave a comment:


  • Dala
    replied
    Continuing from the last post:
    The EVcan is available on the OBD2 port, on the nonstandard pins "CAN-L (12), CAN-H (13)"
    Pinout of the car OBD2 connector:


    To capture the CAN data, I use a laptop with an USB Kvaser Memorator Professional. Oh, and a 120Ω terminator.
    Last edited by Dala; 31-08-2019, 08:33 PM.

    Leave a comment:


  • Dala
    replied
    I've been spending heaps of time getting to know the Nissan Leaf CAN system. Here is a compressed version, to quickly get you started with debugging the LEAF CAN system.

    The LEAF uses standard 11-bit frames. Bus speed is 500kbps. There are 4x CAN buses available, CARcan, EVcan, QCcan and AVcan. We are only interested in the EVcan for correcting battery upgrades. Message speed in ms is 10/20/40/60/100/103/500/512 depending on which bus and message you look at. Stuff like amperages and voltages need to be communicated extremely quickly (10ms), but lower priority stuff like sending stuff to the instrument cluster is 50x slower (500ms)

    The EVcan bus is extremely tolerant to errors. You can pause communication, and the car triggers limp mode, and on resuming communication the errors are cleared. Reverse engineering by simply modifying and seeing what happens is totally doable!

    Lets take a closer look at frame 0x5BC on the EVcan, it contains much good stuff and is sent every 500ms from the LBC->VCM
    0x5BC Frame, captured with CANrunner from my 24/30kWh bruteforce battery LBC
    HEX: 0x17 c0 f0 64 c9 03 02 d0
    DEC: 23 192 240 100 201 3 2 208
    ‭BIN: 00010111‬ 10000001 11110000 1100100 11001001 0011 ‭0010 11010000

    The Battery Gauge display on the instrument cluster is powered by the GIDs signal (the first 10 bits of 0x5BC). The km estimate that the Guess-O-Meter spits out is also linked to the available GIDs. From example frame (BIN 1011110 = 94 DEC) for 94 GIDs available!

    0x5BC bits 36-39 (the high nibble of the 5th byte) affects the battery charge gauge, lower numbers mean more bars. This section probably contains how much one GID is worth OR some degradation offset.

    The battery capacity gauge (the bars outside the fuel gauge) is controlled by a muxed field, when 0x5BC bits 32-35 (ie the low nibble of the 5th byte) is 0x3, 0x5BC bits 16-19 (ie the low nibble of the 3rd byte) contains the capacity bars. Changing this value directly manipulates the number of bars displayed, the value on the can bus is literally the number of bars. From example frame (BIN 1100 = 12 DEC) 12 capacity bars available!

    Leave a comment:


  • Kaktus
    replied
    That's brilliant Dala, well done! Best of luck with your new venture!!

    Leave a comment:


  • Dala
    replied
    Woo! Website is live! https://dalasevrepair.fi/

    Leave a comment:


  • Dala
    replied
    Originally posted by MHR1294 View Post
    So are the plates to keep the cold out, or does it help with aerodynamics?

    did you repair/get a new shield for the underside?
    Purely for aero purposes! Not gotten a new shield yet, but the temporary will hold for quite some time.

    So, some stuff has happened today. The 40kWh from Norway arrived!

    I actually used an internal combustion engine today. I would love to have a proper tow hitch on my EV, felt so unnecessary to use an ICE vehicle to get the battery home. Even though the gas only cost me ~12€ (80km) to get this to the garage, I always feel cheated knowing that money could have bought me electricity instead, and gotten me almost 1000km instead! It's insane how cheap EVs are to run!


    Secured the battery


    It's a 40kWh alright! (2018, 6k km)


    This battery will make an early gen Leaf go almost 300km on a single charge! More on this soon

    Leave a comment:


  • MHR1294
    replied
    So are the plates to keep the cold out, or does it help with aerodynamics?

    did you repair/get a new shield for the underside?

    Leave a comment:


  • Kaktus
    replied
    Nicely done Dala, getting there!

    Leave a comment:

Working...
X