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

  • #76
    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.

    Comment


    • #77
      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!

      Comment


      • #78
        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....

        Comment


        • #79
          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

          Comment


          • #80
            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.

            Comment


            • #81
              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.

              Comment


              • #82
                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

                Comment


                • #83
                  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.

                  Comment


                  • #84
                    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.

                    Comment


                    • #85
                      I am soon going on a work trip to Australia but it was postponed one week, so I'm trying to do a quick sideproject until then.

                      It hit me that I need a way to read the battery health and stats from batteries not currently in a car. There are very pricey solutions already on the market, but I think I can make one for a fraction of the price. Might also learn something.

                      This is the B24 connector from a 2017 Leaf Battery. This is a proprietary 'Yazaki' connector that is extremely hard, if not impossible to source. I've removed this from the pack so I can more easily test and take measurements. 3d printing is the only sensible option here.


                      Here is the pinout for the connector


                      Now what we want is a way to connect the EV-CAN to an OBD2 port, and some way to power the whole thing with an external 12V battery. The battery only wakes up if +12V is applied to it. Will need to come up with some battery solution.

                      I found a great starting point for the connector, WolfTronix over at https://www.diyelectriccar.com/ has made a template for the 2013+ connector. Note that the 2011-2012 Leaf use a different styled connector (21pin instead of 36pin)

                      Here is the first 2013+ prototype printed. I used dupont connectors as suggested on the diyelectriccar forum


                      Now just to wait for the glue to dry and solder an OBD2 port on the other end!

                      Comment

                      Working...
                      X