Yamaha XJR 1300 - Build log - 18kWh cap. 35kW peak

hmmmniek

1 mW
Joined
May 5, 2022
Messages
13
Hey! I've been lurking the forums for a little while now, since I have been planning a conversion of an XJR 1300 for a while in my spare time.
Now I will finally have a bunch of spare time to work on this project. All the parts are in, and the plans for the battery build are pretty much finalized.

Battery build is part one of my project. I intend to keep this thread alive with regular updates for a long time. Since I know this project will take me a long time to finish.

The plans for the battery build are pretty much done, but other details about this project are not entirely finalized yet. My approach to this project is to divide-and-conquer. Battery building is step 1. After that, I will focus on testing all electronics. Making a minimum viable product. And continuing from there.

When I say plans for battery build are done. What I actually mean is that plans for the first layer of the battery are finished and ready to be assembled.
I am planning to build 4 separate 35S 18650 battery packs. With varying capacities, connected in parallel. Controlled by a single BMS.

I like documenting in detail, so let's start from the beginning.

Part 1; Designing
I bought this XJR 1300 second hand. It still ran well, but now I have sold the engine and a bunch of other parts. So I am committed to the project now ;) Using RealityScan, I created a simple 3D model of the disassembled motorcycle.
1718619813751.png

Using this model, I can overlay a simplified and representation of the relevant section of the frame. I do all the 3D designing using OpenSCAD. As a software engineer, this software felt the most intuitive.
1718620263582.png

Now, I already knew the specifications for the battery pack that I wanted to build. It was going to be a 35S45P pack. This is determined based on the max voltage rating of my chosen components, and a conservative range estimate of 200km highway speeds.

I just needed to figure out how to fit all the batteries into this frame. It will be a large pack. So finding the right shape is a challenge.
I had some criteria;
1 - It should have airflow going through it. I can't water-cool the pack because of practical constraints, so air-cooling is the best I can do.
2 - It should be mounted decently, preferably using existing engine-block mounting points.
3 - It should not block any components (handlebars, sidestand etc)
4 - It should leave enough space for controller, BMS, on board charger, dc-dc converter, circuit breaker (optional; storage space)
5 - It should look somewhat decent, "aerodynamic"
6 - It should not be too wide for your knees

Because my desire to build a pack with enough airflow, I felt I had 2 options. Either build vertical pack layers, or horizontal layers.
Exploring vertical layers using some basic paint mockups, made me realize that fulfilling criteria 2 and 4 would be difficult.
1718621441898.png1718621468454.png

So I started exploring horizontal layers in OpenSCAD. Unfortunately don't have any saved screenshots from this process. But I noticed that it would probably be possible to fit a 35S45P pack into the frame, when split up into 4 parallel packs.
1x 35S7P, 1x 35S10P, 2x 35S14P.

All 18650 cells that I bought are capacity tested and labeled. So if I correctly spread out the varying capacities of the cells. Then in theory the pack will barely "notice", that it is actually 4 separated packs connected in parallel. Even though the parallel groups will be split up into 4 parts, I will make sure that every parallel group is still electrically connected to each other with some external wiring/connectors. This way, the capacity between the cells in a single group will not start varying. This way, it is still technically a single 35S45P pack, but they can be assembled in 4 parts.

Another advantage of splitting up the pack into 4 parts, is that I can assemble a first layer, which will give me the necessary voltage to already start testing other electronics. Albeit with lower capacity and limited amperage.

After a while of fiddling about in CAD. I came to the following base shape which would fit my criteria pretty well.

1718620889839.png

Split up into layers, It would look as follows. The top 2 layers are still not finalized. The second from the top layer, will probably house all electronics, controller, BMS etc. The very top layer could be used for a small amount of additional storage (a glove box, if you will).
1718622347846.png

Using a digital drawing tool, I figured out some ways to organize the groups within each supposed battery layer. Optimizing for as much "parallel contact" as possible between each group. Of course this is not possible everywhere, because of strange shapes that I ended up with. However, I see it as a fun challenge to build this battery pack as compact as possible. It will not be possible to have groups of simple straight rows everywhere.
1718624283027.png

Next, we can start "hollowing out" the layers. Making space for the cells. Also adding points for external connectors (power, thermistors, and pack voltage balancing connections) And at the same time we can start modeling space in the layers for mounting points.

1718622915494.png

Removing the scan now to remove clutter. Mounting the battery pack layers will be done by "squeezing" the pack in between EP GC 202 (FR4) sheets. These sheets are then supported on 4 corners using steel tubes which will be attached to the original engine mounts.

I chose the glass cloth reinforced epoxy sheet material, since it is a good electrical insulator. Weather and impact resistant. And most importantly, has a high flexural strength, which has the best chance of holding the weight of all these batteries in a secure manner.

1718623403136.png

After all of this preparation. We can focus on the first (bottom, and smallest) battery pack layer.
We split it up in 3D-printable sections. Add assembly holes. Space for internal wiring. Space for structural rods that help to keep the pack together.
1718624038524.png

End of part 1
In reality, I am already a bit further ahead than what I am writing in this initial post. The first battery pack layer parts have been 3D printed. The copper sheets that will be used to connect the cells have been cut out in their correct shapes. And I am currently organizing and pre-balancing the cells before starting with spot-welding the first pack layer together. I will write another update post about this process after a while when I feel like I have reached another meaningful milestone.

The designing step is done for the first battery pack layer. But is still not finished for layer 2, 3 and 4. My plan is to assemble the first layer. Then use that first layer to test all electronics. And maybe build a first version of the motorcycle with limited capacity and 1/6th limited power.
After that all seems to work, I will be able to start building the next layers, slowly increasing the available power of the motorcycle build.
 
Great design approach and use of tools.
Did you use a solver for the optimisation of parallel contact based on dimensional constraints for each layer or was it more of an eye balling exercise?
With the option to monitor 35 cells groups spread over four packs you may want to consider fusing on the balance wires. I think there was an post on the arrangement somewhere on ES. I'll see if I can find it.
 
I'd like to hear more about your battery plans, this sounds like a novel idea.

First, you're using 1575 cells. Wow. I just finished an 840 cell pack, and I thought that was a lot...

Have you decided what cells you will be using for your build.
1 - It should have airflow going through it. I can't water-cool the pack because of practical constraints, so air-cooling is the best I can do.
Because I'm not sure cell cooling is going to be necessary.

As a rough estimate, I would guess that at highway speeds, you're probably going to be seeing 12-16kw continuous. Let's call it 16kw. Your plan is 35s. At 3.7v nominal, let's assume 130v nominal pack. 16kw/130v = 123amps, divided by 45 cells in parallel, so 2.7amps per cell. Now that's continuous rating, at highway speeds. What I mean to say is, with your planned pack, 2.7 amps per cell isn't a lot, and you cells are not going to be seeing much heat increase. There are a lot of cells out there that can handle that easily. For example, I'm using LG MH1, which are rated for 10A continuous with a rise to 50 degrees C. But I only ever pull 5 amps continuous, and they never warm up more than 2-5 degrees above ambient at those rates.

What i mean to say is, while it certainly won't hurt to consider airflow and pack cooling, I'm not sure you need to stress too hard about it. Even if you double my above estimates, to continuous discharge of 30kw, you're still only asking about 5 amps per cell. And even some full sized cars sometimes don't see 30kw on highway speeds.

In other hypothetical numbers. 1575 cells, assume 3000mah cells like the LG MH1's. That would give you an estimated capacity of 17.4kwh. Damn. The Harley LiveWire only boasts 15.5kwh, 13.6 usable. If you were to assume an efficiency of 120wh/mile, which is reasonable for a heavy motorcycle like yours might be, you'd be looking at a range of 145 miles. At highway speeds. If you can pull this off, I (and others) would be very impressed.

Anyway, this is the biggest DIY battery I've ever seen planned for a motorcycle, and I look forward to seeing where it goes.
 
Great design approach and use of tools.
Did you use a solver for the optimisation of parallel contact based on dimensional constraints for each layer or was it more of an eye balling exercise?
With the option to monitor 35 cells groups spread over four packs you may want to consider fusing on the balance wires. I think there was an post on the arrangement somewhere on ES. I'll see if I can find it.

Thanks!
For optimizing the shape and internal layout, I mostly did this by eye. I am not aware of any existing tools for this. It took me some days to optimize it manually, but its kind of like solving a puzzle. Relaxing :) So I didn't mind putting in the time haha!

Have you found the link to this "fusing"? I do not understand what you mean with this. My current plan is to simply run small guage wiring connecting all the groups together. This wiring will also be directly connected to the BMS. So while the parallel groups are each split up into 4.. they are electrically all connected to each other, so the voltage in the split groups will remain stable.

I'd like to hear more about your battery plans, this sounds like a novel idea.
I'm more than happy to talk about it. Building the battery is the most fun and exciting part of the project for me!
First, you're using 1575 cells. Wow. I just finished an 840 cell pack, and I thought that was a lot...

Have you decided what cells you will be using for your build.
I bought my cells secondhand from 18650BATTERIES.EU , great guy if you are in the Netherlands! Highly recommended.
1600 INR18650MJ1 cells. They have been in storage for about half a year now. Of the 245 cells that I checked so far for the first battery layer which is slowly being spot welded now in my spare time, only 1 self discharged to 2.01V (so this one was set aside obviously, that's why you order slightly more cells than you need :p ).
Because I'm not sure cell cooling is going to be necessary.

As a rough estimate, I would guess that at highway speeds, you're probably going to be seeing 12-16kw continuous. Let's call it 16kw. Your plan is 35s. At 3.7v nominal, let's assume 130v nominal pack. 16kw/130v = 123amps, divided by 45 cells in parallel, so 2.7amps per cell. Now that's continuous rating, at highway speeds. What I mean to say is, with your planned pack, 2.7 amps per cell isn't a lot, and you cells are not going to be seeing much heat increase. There are a lot of cells out there that can handle that easily. For example, I'm using LG MH1, which are rated for 10A continuous with a rise to 50 degrees C. But I only ever pull 5 amps continuous, and they never warm up more than 2-5 degrees above ambient at those rates.

What i mean to say is, while it certainly won't hurt to consider airflow and pack cooling, I'm not sure you need to stress too hard about it. Even if you double my above estimates, to continuous discharge of 30kw, you're still only asking about 5 amps per cell. And even some full sized cars sometimes don't see 30kw on highway speeds.
I know that it probably won't be absolutely necessary. But I like to build my battery pack to the best of my knowledge, and to the best of my practical abilities. Airflow/cooling is a fundamental part of any battery pack. Even if it is technically not necessary in all cases. I like to keep it in mind anyway, just in case. And besides that, splitting up the pack also allows me to distribute the weight over more mounting points. I intend to make this build road legal. In the Netherlands this is no easy task as they have many laws and regulations. The more sturdy I can build this, the better!.

Same goes for the discharge rate. I like being on the safe side. Both because I really would love to have a high-range build at the end. And also I don't want to replace the pack after 3 years because I was abusing the cells with a load that was right up to its theoretical limits.


In other hypothetical numbers. 1575 cells, assume 3000mah cells like the LG MH1's. That would give you an estimated capacity of 17.4kwh. Damn. The Harley LiveWire only boasts 15.5kwh, 13.6 usable. If you were to assume an efficiency of 120wh/mile, which is reasonable for a heavy motorcycle like yours might be, you'd be looking at a range of 145 miles. At highway speeds. If you can pull this off, I (and others) would be very impressed.

Anyway, this is the biggest DIY battery I've ever seen planned for a motorcycle, and I look forward to seeing where it goes.
You don't need hypothetical numbers. I have sorted and indexed every cell that I bought based on the tested capacity of the seller, which is printed on the label of each cell.
1719178208436.png

I can't completely trust the values though, as an average of 3624 seems very high. I think a pack of 20kWh can be realistic though. We will see when its finished!

Good to hear I am making others excited for this battery build as well! I will pull this off, just wait and see ;)


Part 2; Start of assembly, pack layer 0
The first problem of assembly is; where should each cell be placed in the pack? Just picking and placing random cells into parallel groups can create a pack which is out of balance. A BMS can handle this, but it would be nice to make the BMS do as little work as possible. We can do this by picking and choosing cells in an organized manner.

As mentioned before; I have sorted and indexed every cell that I bought for this project into an excel sheet based on its stated capacity. With this list, I used rePackr - 18650 pack builder to optimize the pack into 35 groups of 45 parallel cells. These 45 parallel cells are then again split up into 4 groups. Of 7, 10, 14 and 14 cells. Layer 0 is the smallest battery pack layer with groups of 7 cells.
The groups created by repackr all have very similar capacity. That makes sense, because each group has the same amount of cells. We have to apply a similar logic when splitting up each group into 4 sections. Each of the 4 sections will be electrically connected to each other. But if we just randomly pick and choose from each group of 45 cells, then we could end up with 7 low capacity cells in layer 0, while layer 2 might have 14 high capacity cells. If this happens, then a high current could start flowing through the balance wires, as the 14 cells might start "trying" to charge the low capacity group instead. This is of course incredibly inefficient.

If 45 cells should provide 100 percent of the current, then it is only logical that 7 cells should provide 15.56 percent of the current.
We won't be able to hit this percentage exactly because of variations that cant be avoided, but at least we can attempt to get as close as possible. Which means that little current will flow through the balancing wires. To provide 15.56 percent of the current, we should create a battery pack that has 15.56 percent of the total capacity.
Luckily I am a software developer, so it was relatively easy to write a little script to optimize the groups when split up into 4 parts, based on the result from repackr. This code can be found in my Github repository; motor/optimization.ts at 6226de69f91a437ec1b4b913de40c8f4b867b7bb · niek-dewit/motor

After we have this result. We can start picking the cells that should go into each parallel group of layer 0. Using my excel sheet and conditional formatting rules. I can highlight the cells that I need to pick and place in the group. Each column in excel corresponds to a physical box of batteries. The row number corresponds to a place in the box. That way, I know EXACTLY where I can find each cell.
1719179766239.png
Using way too many TRIPLE MEAT XL SIZE BIG AMERICANS pizza boxes that I just happened to have lying around, to temporarily hold the cells.. pre-sorting. Difficult to see, but I wrote parallel group numbers next to each row of cells on the box. We are not losing track of what-is-what here!
1719179675414.jpeg


Every cell that I pick and stick into a pizza box is checked for the voltage. I found one cell which self-discharged to 2.01V. This cell was discarded and replaced with a different cell of similar capacity which had not self-discharged. Any parallel group where the cell voltages varied by more than 0.08V was put into this passive voltage balancer for a night. This allows the battery voltages to slowly and safely reach an equilibrium. With 10 Ohm resistors in series with each cell. It takes about a night for a group to find and equilibrium. Luckily only 4 groups had a voltage difference of 0.08 - 0.11V, which I put into this device just to be sure. But as far as I know, even 0.15 should be safe for spotwelding.. I just like being extra sure.
1719180110006.jpeg1719180217416.jpeg

In the meantime, I have cut and punched out all the shapes that I need from 0.1mm copper sheet. Of course all according to my digital plan and labeled accordingly.
1719180364938.jpeg1719180422250.jpeg

Some of the copper sheets require power wires to be soldered on. Of course you don't want to do this when they are already welded on. Since you wont be able to avoid destroying the cells around it. I had to solder on power cable on 3 copper sheets. Twice for the positive and negative terminal. And once for a "crossover" point in the battery pack, where the copper sheet on its own wouldn't have sufficed to carry all the current.
1719180505468.jpeg1719180863584.jpeg

Next, I'm adding screw inserts into the 3D-printed cell holders. There will be 48 m3 screws in total to hold the pack in between the EPGC sheets. Based on 0 calculations and 100 percent gut feeling and hope that it is enough.
1719180900058.jpeg

Now we can start picking the cells from the pizza boxes, and into their final spot into the cell holders. Of course, according to the digital plans. I considered optimizing the individual placement for capacity of the cells in the same group next to each other.. but I figured that would probably not make much of a difference.
1719181059126.jpeg1719181075153.jpeg

Next step; adding 4 thermistors with thermal adhesive in locations in the battery layer according to the digital drawings. And finally placing the 3d printed top cell spacers. These spaces have been printed in 4 parts, and are slotted together using a dovetail connection. Seems to work very well! I have build a 2kwh electric bicycle pack in the past using injection molded spacers. The 3d printed spacers are way nicer to work with! I designed it so that it leaves an 8mm hole for spot welding. The plastic around the hole is also an extra insulator for the positive terminal. Replacing the "fishpaper rings" which are often used with injection molded cell spacers.

I also printed a "helper tool" and a couple thumb screws that can be screwed into the screw inserts temporarily during assembly (for tool alignment). This helper tool was used to make measurements for cutting out the copper sheets. And will later be used to find the spot-welding locations when the copper sheets are on top of the cells. Since knowing where the center of each cell is, can be difficult when the copper sheets are on top. This little tool will allow me to find the exact center of the cell perfectly each time for very consistent spot welding.
1719181220636.jpeg1719181510185.jpeg

Now finally for spot welding. I am using small pieces of nickel plated steel strip on top of the copper. The only reason for this is to help with generating enough heat to weld the copper to the cells. In my documentation, I can't find the exact model of my cheap spot welder board that I am using for this. But I can share some pictures if anyone is interested. In any case, the spot welder is connected to a large car battery, configured to deliver 3 strong pulses. This creates very strong spot welds which rip apart the copper sheet if you try to pull it off with some pliers. Only downside is that the spot welder wires get hot very quickly. Too hot to touch. So I can only weld a few cells before having to take a short break to let it cool down.
1719181697194.jpeg1719181708545.jpeg

This is the status of the battery pack today (24 Jun). I will slowly be making more progress on finishing the spot welding. Busy with other things the coming few days. But I will post another update when that is all done. And happy to answer any questions in the meantime! :)



In order to get all these steps done, I have made a protocol for myself. Partly because I am a very forgetful person. But also because I will have to do this 3 more times on the other battery pack layers. And I do like being consistent in my process.
My steps are as follows;
My battery pack layer assembly bible:
  • Design shell ✅
  • Create space for internal wiring and structural rods ✅
  • Print shell ✅
  • Print spacers ✅
  • Create diagram for
    • Locations to punch holes for wiring, sensors and screws✅
    • Locations for bms lead soldering✅
    • Shapes of copper sheet✅
  • Super glue splits✅
  • Add screw inserts into spacers according to diagram✅
  • Note down location of positive and negative pack terminals on the bottom cell spacers✅
  • Sort and place cells into bottom cell spacers✅
    • For each group, measure voltage, max difference should be no more than 0.15v✅
    • Balance voltages of each group✅
  • Add 4 thermistors to the cells using thermal adhesive according to diagram & Add top cell spacers✅
  • Cut out copper sheet shapes according to diagram using the helper tool✅
  • Punch holes in sheets according to diagram using the helper tool✅
  • Solder power wires to positive and negative battery pack copper sheet terminals✅
  • Solder power wires to any internal copper sheet crossover points✅
  • Solder bms leads to nickel plated steel tabs
  • Clean fingerprints and grease from copper sheets & Weld sheets to the pack according to diagram
  • Tape wiring down, avoid holes with screw inserts
  • Add layer of kapton tape
  • Add rubber spacing layer
  • Pull data leads through pack and solder to the PCB
  • Pull power cable through pack, crimp and solder on connector and attach to the external power connection point
  • Add connecting rods and pack shell screws
  • Fabricate shapes and holes of supporting epoxy glass cloth sheets
  • Attach supporting sheets onto the pack using screws
  • Insulate external battery terminals

End of part 2
 
Clearly you have this all planned out well, in a way that works for you. So you're really going to fit 1575 cells in a motorcycle? Can't wait to see. The capacity and power will be more than any electric motorcycle out there, I think!

Based on everything else you've described, hopefully you've considered this and don't mind me bringing it up: your first spot welds look too hot. Obviously you need significant power to get the copper to adhere to the cell. But from the color in the pictures you've posted, it seems like far too much power. Have you done tests on scrap cell, where you've welded at this power level, tore it off, and inspected the cell beneath? I'm sure you have, and I hope you don't mind the note.

At the very least, you should spot weld one per cell, then move to the next cell in the group of 7. After the first spot weld on number 7, you can then return to cell number 1 for the second spot weld. This allows the cells to shed some of the heat you've given them. If you weld 3-4 times in a row on one cell, especially with the power you are using, the heat buildup could reach damaging levels.
 
Thanks for expressing your concern about the intensity of the spot welds. You might be correct. It is indeed a very hot weld, but I feel this is necessary to weld the copper to the cells. Discoloration is only occurring on the nickel plated steel strips. Copper underneath seems fine. I did indeed also do tests on scrap cells! Your suggestion for doing a single spot weld and moving to the next cell is very good. I will start doing this from now on. Luckily I have only done the 2 sheets from the previous pictures so far!

1719184078502.png
 
Thanks for expressing your concern about the intensity of the spot welds. You might be correct. It is indeed a very hot weld, but I feel this is necessary to weld the copper to the cells. Discoloration is only occurring on the nickel plated steel strips. Copper underneath seems fine. I did indeed also do tests on scrap cells! Your suggestion for doing a single spot weld and moving to the next cell is very good. I will start doing this from now on. Luckily I have only done the 2 sheets from the previous pictures so far!

View attachment 355283
See, this picture looks good. The welds are clearly strong, but not so discolored this time. And the cells underneath aren't discolored at all.

Of course, the other reason you need to be careful is that adding too much heat to the cells, too quickly, could make them pop. Good luck.
 
I couldn't find the link. The key consideration is that any voltage mismatch between the cell groups that you parallel through balancing wires will result in current flowing through the balance wires. Conventionally batteries are connected in parallel as below:
17.jpeg
In this configuration you would monitor all 35S x 4P (140) cell groups individually and no current would flow through the balance wires under discharge.
DALY BMS have some products like the 1A active balancer and parallel module that could be suited to your modular battery approach.
Alternatively, I am using a copy of the Ennoid BMS for my 28S battery which can be split into to 14S parallel groups for a different application. Ennoid offer a 18S slave board which would suit your design too, but it would be costly.
 
Looks like paralleling the balance leads is a done thing, links:

 
Part 3; Finishing assembly of pack layer 0
I have been busy at work assembling the first battery pack layer. Not without its fair share of issues and setbacks. But it all seemed to have worked out in the end.
In the last update, I had already organized all the batteries in the spacers, had checked and balanced the group voltages, and started with the first spot welding. In this part, we are finishing the assembly, to the point that we will be able to use the voltage of this pack to start configuring and programming the BMS, Charger, Controller and DC/DC converter.
1724758590706.png
In the picture above, you can get an idea of what we are assembling now exactly. I call this "layer 0", it is the bottom most layer of the battery pack. Each layer is assembled separately, and connected in parallel. This has the advantage of having additional airflow between the packs. Having more separation between batteries. Better weight distribution of the cells using multiple mounting points. And finally, this allows me to work on this project in smaller phases, building 4 "small" packs instead of 1 huge pack.

1724758842563.jpeg1724758854690.jpeg
My spot welding process looked as follows. First spot welding all the sheets onto one side. This is still very safe to work on, since the voltage between 2 plates will never exceed twice the individual cell voltage. So extra safety precautions were not necessary yet.
I used a 3d printed guide to put on top of the sheet which I am welding to the pack. The reason for this, is that it is otherwise difficult to tell where the center of each cell is which I need to weld on. With this, I am able to get the welds on the exact center of the cell underneath the sheet.|


Spot welder issues
I initially used this spotwelder from aliexpress ( https://nl.aliexpress.com/item/1005006411596764.html ). Which I highly discourage from using. I cant find it anymore for sale on aliexpress right now. Which is a good thing, because while spot welding, at some point the mosfets exploded while burning a small hole in one of the cells at the same time. Luckily no internal shorts of that cell were created when this happened. I removed that cell and replaced it with a fresh one. Then ordered a new welder.

I got this one next ( https://nl.aliexpress.com/item/1005006821589647.html ). Seems like a slightly modified version of the initial spotwelder. Which has not exploded yet while welding the rest 3/4ths of the battery pack. However, this might only be because I printed an enclosure with a 120mm fan continuously blowing on the welder while I'm using it. My hypothesis was that the first welder exploded because it got too hot. However, this spotwelder also seems to have some QA issues, since it initially never turned on, only after manually hacking in a usb cable to supply 5v power to the board, it turned on. Seems like in my unit, the 12v to 5v power circuit was not working. Do not recommend. Makes strong welds when it works though.


Welding the other side
1724759920373.jpeg1724759987315.jpeg1724760240137.jpeg
Welding the other side was.. scary. But I believe working on a battery like this, feeling some healthy anxiety is a good thing. Even though I tried being as careful as possible. I still made mistakes. I do not want to hide these mistakes in this post. Since it is good to not be over-confident around batteries like this. Even when you think you took the necessary precautions, you can still be an idiot like me.

I always worked with insulating gloves on. And each sheet that was welded onto the pack was immediately covered with temporary paper taped to the pack. But still, I welded holes through the pack TWICE. The first time was a bummer but no big deal; It just so happens that this pack design has 2 empty cell "spots". While welding everything together, after welding hundreds of cells, I forgot to check in one of those specific spots, if there was actually even a battery underneath the spot that I was welding. Which resulted in me blowing a huge hole through the copper sheet. Luckily no other cells were damaged because of this.

The second mistake I made was more serious. And I feel incredibly stupid, because I know better. Anyway, the little metal tabs that I put on top of the sheet in order to sandwich weld the copper directly to the cell.. after welding, they kind of potato chip upwards, leaving sharp corners sticking up. I always went over these corners with a metal butter knife to push the corners down (not sure what I was thinking honestly). Which went well, until it didn't. Turns out that while covering up the previous sheets with paper, I left the tiniest edge of exposed copper, and while pressing down the corners of a different sheet, I shorted the 2 sheets with the butter knife. Resulting in almost blowing a hole through the knife, and completely vaporizing the positive terminal of the cell underneath that edge of exposed copper.

This made me genuinely reconsider if I should continue working on this project. Since the spotwelder(s) burned a hole in my pack 3 times now. I started to doubt if this is something I should be doing. But after removing and isolating the damaged cell (still didn't create an internal short somehow, lucky), taking some time to relax and think about the whole process. I decided to continue. These are mistakes that are now burned in my consciousness that will help me to work more safely moving forwards.

1724761110847.jpeg
Adding the BMS leads was luckily less eventful. On both sides I pre-soldered the wires to nickel plated steel tabs, and welded those on top of the sheets. Making sure to only expose the MINIMAL amount of copper as possible of the pack internals. (I also switched from a metal butter knife, to a hard plastic tool ;)
1724761325324.jpeg1724761352955.jpeg
After finally wrapping the whole thing in a few layers of kapton tape, my anxiety finally slowly started to cool down a little bit. Still being extremely careful with the BMS leads and terminal cables of course, which were taped off for now.
1724761509807.jpeg1724761525405.jpeg
Now adding a layer of 5mm self-adhesive neoprene cellrubber, on the edge 1mm of the same material. This allowed the 3d printed shell to have some overlap with the battery pack, while still keeping space for the wiring to go in between the shell and the pack.

1724762531899.jpeg1724762562295.jpeg
I prepared the connector for the BMS leads and temperature sensor leads. Making sure to double check for shorts before soldering everything together on the battery. I was NOT ready for another big mistake ;) To check for shorts, I shorted all wires except 1, then checked for continuity between all wires and that 1 loose wire. Then I swapped the loose wire for a different one, and repeated that process for all the connections.

1724761795221.jpeg1724761961124.jpeg
Getting the wiring through the shell and "neatly" organized on the pack so that there are not too many wire "crossings" that would make the wiring too bulky.. that was an absolute struggle to do. I will have to come up with a better solution for this in the next pack layer.
Also, if you look closely, all screw holes are filled with a screw, except for the ones on the back. I did not add any tolerance in the design of this pack. So it was all fitting together a bit too tight, I wasn't able to fit the parts in the back. Luckily, adding some tolerance, and re-printing the 3 sections in the back was enough to make it all fit.


1724762218757.jpeg

I love this picture, because you can see so well how it all fits together now. 2 strong sheets, with a plastic shell in between, held together by some threaded rods. Which then contains the whole battery pack. Having a lot of small screws that firmly attach the pack to the outside sheets.

1724762336067.jpeg

TLDR
Assembling this first battery pack layer has been an incredibly humbling process. However, I am incredibly happy that it all ended up working out in the end for this layer. I learned a lot from all the mistakes I made here. And I am sure that the next layer will go a lot more smoothly, hopefully without vaporizing any 18650's or burning holes through copper sheets. Next up, I will take a break from assembling battery layers. I will be focussing on using this initial layer, to program and configure all the other hardware that I have laying around here. The BMS, DC/DC converter, Charger, Controller etc. Also getting the mechanical throttle cable attached to a hall sensor. It will be exciting! I might finally be able to get the wheel spinning for the first time in the next update.
 
Today not a big update but rather a question to the community. Whether others have experience with ENNOID-BMS master-slave boards. Since specifics on how to connect them seem difficult to find. I have been setting up a test-bench with all my electronics.

And decided to connect the BMS for the first time today. Lo and behold - I got to enjoy some magic smoke today. Specifically, I used the distributed BMS and slave boards from MAXKGO. ( MAXKGO LTC6813 18S ). Which is based on the open source ENNOID-BMS designs.

The voltages I applied to the inputs are as follows; Increasing voltages according to the numbering. GND on 0 volts on both boards. Seems like this was not the way to go. Since I burned some components on the second board. Seems like the components which were burned, were also the components experiencing the highest voltage potential difference.

My best guess right now, would be that GND on the second board should have been 66.6 volts instead. So that the difference between GND and 1 is actually ~3.7 volts. Anyone able to confirm this? Seems kind of obvious in hindsight, but also at the same time, I have not read anywhere that this should be the way to do it. All I am reading is; GND should be connected to the negative terminal of the battery pack. Which seems to be true only for the first slave board I guess?

I am also contacting MAXKGO support about this. But since I ordered these components from an Aliexpress store, I don't think I'll have any luck with using some kind of warranty on this.

1727446243009.png
 
After finishing the first battery pack layer. I immediately got to work with laying out all the components. The OBC, DCDC converter, Controller, BMS etc. My plan was to create a crude general layout that I can put on my desk so that I can start connecting everything together, configuring, and programming the system. So basically a test-bench that I can easily use to learn about this system. Since I still have a lot to learn about how to control all these electronics.

First, I had to create a connector that allows me to connect all the BMS wiring to the battery pack. As you can see in the pictures, all the battery pack layer groups will be connected in parallel. So it is basically a big 1 > 4 connector splitter cable if you look at the BMS balance wires. The temperature sensors, which are also in this connector, are not paralleled across the 4 connectors of course. Each battery pack layer will get 4 temperature sensors.
1729520874993.jpeg1729520884540.jpeg1729520887764.jpeg

After getting the outside connectors ready. I started setting up the test bench. Just screwed into a wooden plate for now, that I can place above the battery pack, this will be all pretty close to what the final layout of the components will be once installed in the motorcycle.
1729521214419.jpeg
Since it is now all pretty much already in the right position, it will be a lot more simple to start making all the busbars and other wiring that is necessary. To get a sense of it all, I decided to first make an abstract model of how everything should theoretically be connected.
1729521435084.png
Something I had not expected or thought about beforehand, is the fact that I would need an additional auxiliary 12v battery. This is an important safety consideration. Since without it, my only source of 12VDC power, would be the DCDC converter, which would have to be DIRECTLY connected to the traction batteries. Since the BMS needs a 12VDC source in order to activate the main power contactor.

However, connecting the DCDC converter directly to the traction pack is simply not possible. First, the DCDC pack also needs a 12VDC enable signal in order to turn on. And second, it just seems like a generally bad idea to connect anything directly to the traction pack without a BMS in between.

So the DCDC needs 12VDC signal to turn on, and the BMS needs a 12VDC signal to turn on. There will be no other option, other than to include a small 12VDC power source. I opted for a small AGM 0,8 Ah 12 V battery for 15 euros. This auxiliary battery will serve 2 different purposes; It will provide the whole system with an initial 12V supply to turn on the BMS, and send an enable signal to the DCDC converter. After the BMS is turned on, the DCDC receives the traction pack input voltage, and outputs its own 12-14VDC power, which is then used to keep the auxiliary pack charged, and also to power any of the lights and accessories that run on 12V.

The Second use for this auxiliary battery is also very important. In the event when something goes wrong with the traction battery, and the BMS performs a hard shut-off. All power will be lost in the system, except for the auxiliary battery, which will make sure a 12V supply will still be there. If I would be riding in the dark, and the BMS shuts off, at least I would still have my headlights to find my way to the side of the road and turn the hazards on. A 0.8Ah AGM battery is not going to keep the lights on for long, but long enough to get to a safe location.

I hope I will never have to experience this though, however, its nice to know that the failure mode is as safe as possible.
Luckily, the BMS is also able to monitor the temperatures, and voltages of the battery, and react accordingly. For example when the battery is already low, it will broadcast messages on the CAN bus that instruct the system to limit throttle/power output to a certain percentage, making sure to not overload the battery, before doing a hard shut down. So you will have enough time to respond to this warning, and maybe get off the highway to let things cool down if that is the case.

The traction power connections I decided to make from 12mm diameter, 1mm wall copper tubing. Which gives us about 37mm2 copper conductor. Should be enough to conduct a high traction current continuously. According to some sources online, probably around 120A continuous safely. Which would be around 15kw continuously. Which I expect to only reach during peak current output.

1729522351907.jpeg1729522359980.jpeg1729522858143.jpeg

Now while assembling all of this. I made 1 big mistake. I accidentally shorted the battery while bolting down the power cables. Of course I felt awful that I made such a mistake. Luckily everything was mostly okay. But I took a few days break from this project to think about why I made this mistake, and how I could change the design to prevent this from happening.
Basically the mistake that I made was the result of bad design from my battery. The way the outputs were laid out, it was impossible to prevent your tools (wrench etc) from moving in a way that would likely short the terminals. So I changed my design to instead use 2 (brass for electrical conductivity) bolts that come straight out of the pack. This makes assembly significantly easier, and allows for a lot less dangerous mistakes. Wish I had thought of that before. But luckily, I figured it out before assembling the other 3 traction pack layers that I am planning ;)
1729522899755.jpeg1729522906796.jpeg

Of course immediately after this accident, I kept a close eye on the battery pack, just in case this messed something up inside. At that moment, I did not notice anything obvious. So I hoped that everything would be fine. Unfortunately, later when connecting the BMS to my PC, I managed to read out the cell group voltages, and noticed that 1 group registered 0 volts..

Initially I was hoping maybe one of the connectors was not plugged in well. But while tracing back the voltage, the connector and cables all seemed fine, everything was pointing to the fact that something was wrong with the battery. Measuring the resistance of that 0V group.. 45kOhm :/
Something definitely went wrong, and created a short circuit inside the battery which slowly discharged the whole group to 0V. Luckily there was still some internal resistance, which made sure that not too much heat was generated. Otherwise this could have been a lot worse. I had to open up the battery pack again, dig out the bad group, replace with some fresh cells, and spot weld it all back together. All in all took a lot of precise and focused effort to fix. But managed to fix the problem in the end. Spotted one particularly bad cell which obviously visually endured some abuse, which probably took the whole group with it.

1729523186909.jpeg1729523591953.jpeg1729523608451.jpeg

2 out of 7 cells which I replaced in the dead group. 1 obviously looking worse.
1729523826726.jpeg

After that was all fixed, I was finally able to start configuring the BMS for the my battery. And besides that, I could start listening for CAN bus messages. Since I want to create my own customized dashboard with all relevant information. Besides that, I want to be able to record all internal data when I ride the project. So that I could download that data and analyse it. With that information, I could figure out what went wrong after the fact, if I noticed something strange during a ride.

That is why in the past week I have been messing around with a microcontroller to display data on a couple LCD displays. Eventually I want to use 1 lcd display near the charging port to display charging related information (realtime Amps, voltage, max ams and voltage etc). And the other display probably somewhere near the main dashboard for system information while driving. Which I cannot display using the existing original analog meters. I intend to use the original speedometer, tachometer and fuel gauge to communicate the current speed, amperage, and battery voltage. All other information such as temperature, error codes current/throttle limiting states etc will be displayed on an lcd display near the dashboard.

1729524072727.png

After figuring out how to control the LCD's I started looking into the CAN bus that the BMS should be broadcasting messages on and started to make some interesting discoveries. One thing I initially got confused about was the Enable wire (EN), which I thought might be related to the CAN communication. Turns out, it's entirely separate—just a simple way to programmatically turn on the BMS without having to manually press the power button. By connecting it to 5V, I can automatically trigger the system to power up.

Now, when I started digging into the actual CAN bus communication, I found that all my components—the OBC, DCDC converter, and Controller conveniently operate at the same CAN bus speed of 250kbit/s. This was a stroke of luck because it means I can run everything on a single bus without having to worry about mismatched speeds.

Here’s where things got even more interesting. I discovered that my BMS is natively compatible with my OBC, which I didn’t know beforehand. While inspecting the CAN bus, I noticed that the BMS broadcasts messages with the ID 0x1806E5F4, which is exactly what the OBC protocol expects. The data coming from the BMS translated to sensible values for max voltage and current, which was a nice validation that the communication between the BMS and OBC should work as intended. This means the BMS will automatically limit the voltage and current based on configurations which I can do using the ENNOID BMS configuration tool.
That said, not all of the BMS messages are directly compatible with my motor controller. A bunch of other messages seemed to be geared toward different types of controllers (likely for VESC or EFoiler setups), so I’ll need to extract and transform these messages into a format my controller understands. This is actually fine, though, because my plan is to extract all the CAN data anyway for proper system analytics.

One interesting challenge I faced was decoding the structure of the BMS messages. Each CAN message ID is composed of two parts: the first byte indicates the packet ID, and the second byte is the device ID, which can be configured in the BMS settings. Using the BMS firmware source code, I was able to look up the meaning of different packet IDs. For example, a message with ID 0x2D0A means that we’re dealing with packet ID 43 (0x2D, which corresponds to CAN_PACKET_BMS_TEMPS, so temperature sensor data) and device ID 10 (0x0A). With this understanding, I could dig deeper into the code and figure out how to extract actual temperature data from the CAN buffer.

This is the implementation that we find;
C++:
uint8_t auxPointer = 0;
uint8_t totalNoOfAux =modCANGeneralConfigHandle->cellMonitorICCount*modCANGeneralConfigHandle->noOfTempSensorPerModule;
while (auxPointer < totalNoOfAux ) {
    send_index = 0;
    buffer[send_index++] = auxPointer;
    buffer[send_index++] = totalNoOfAux;
    if (auxPointer < totalNoOfAux) {
        libBufferAppend_float16(buffer, modCANPackStateHandle->auxVoltagesIndividual[auxPointer++].auxVoltage, 1e2, &send_index);
    }
    if (auxPointer < totalNoOfAux) {
        libBufferAppend_float16(buffer, modCANPackStateHandle->auxVoltagesIndividual[auxPointer++].auxVoltage, 1e2, &send_index);
    }
    if (auxPointer < totalNoOfAux) {
        libBufferAppend_float16(buffer, modCANPackStateHandle->auxVoltagesIndividual[auxPointer++].auxVoltage, 1e2, &send_index);
    }
    modCANTransmitExtID(modCANGetCANID(modCANGeneralConfigHandle->CANID,CAN_PACKET_BMS_TEMPS), buffer, send_index);
}

Based on this, we can conclude that each byte in the data buffer contains 3 temperature measurements. And the first 2 bytes are reserved for telling us which temperature sensors we are receiving data for, and the total number of temperature sensors. Looking further, we find the implementation of libBufferAppend_float16
C++:
void libBufferAppend_float16(uint8_t* buffer, float number, float scale, int32_t *index) {
    libBufferAppend_int16(buffer, (int16_t)(number * scale), index);
}

So the scale simply translates to the precision of data which is transmitted in the message. Looking further in the code, we can find the implementation of libBufferAppend_int16.
C++:
void libBufferAppend_int16(uint8_t* buffer, int16_t number, int32_t *index) {
    buffer[(*index)++] = number >> 8;
    buffer[(*index)++] = number;
}

Which is pretty simple, here we can clearly see that each temperature measurement will be transmitted through 2 bytes of data. In our case we have 16 temperature sensors connected, including 2 internal temperature sensors on the BMS slave boards. So 18 total. We can expect to receive bundles of 6 messages with CAN message ID 0x2B. Since each message will contain data for 3 sensors. I can validate this in the CAN monitor script that I am using to monitor the signals on the CAN bus.

1729525153268.png
Now we can take one of these data buffers and take a closer look. See if we can get the data out. 06 12 07 EE 07 EE 07 F7

The first 2 bytes are easy, as we saw in the source code, first byte tells us something about the “index” of temperature sensors that this data is describing. 0x06 easily translates to 6 in decimal. So we are reading data from temperature sensor 6, 7, and 8. The second byte is the total amount of sensors, 0x12 translates to decimal 18, which is what we would expect.

The last 6 bytes we have to split up into parts of 3. 07 EE, 07 EE, and 07 F7. If we convert those to decimal, we get 2030, 2030 and 2039. We had a scale applied of 100, so we divide this by 100, and we get sensible temperature readings of 20.3, 20.3 and 20.39 degrees C

After monitoring and counting the CAN bus messages for a while. We can see that we will have to go through this reverse engineering process a for a few more messages.
1729525232622.png

The status data that I will be able to read from the BMS through CAN are;
0x26: CAN_PACKET_BMS_V_TOT
0x27: CAN_PACKET_BMS_I
0x28: CAN_PACKET_BMS_AH_WH
0x29: CAN_PACKET_BMS_V_CELL
0x2A: CAN_PACKET_BMS_BAL
0x2B: CAN_PACKET_BMS_TEMPS
0x2C: CAN_PACKET_BMS_HUM
0x2D: CAN_PACKET_BMS_SOC_SOH_TEMP_STAT
0x35: CAN_PACKET_BMS_AH_WH_CHG_TOTAL
0x36: CAN_PACKET_BMS_AH_WH_DIS_TOTAL

I am sure that the BMS will broadcast more messages in certain load and charging scenarios. But this is a good start for now. Later in the project, I can just start using the system, while monitoring and logging for messages that are not accounted for.

Thats my big update for this crazy project for this time. I will diving further deep into the CAN bus messages. Reverse engineering the data buffers of the messages and creating a system that logs all of that data preferably to an attached SD card or maybe through a bluetooth connection directly to my phone. We will see! Hopefully soon I will figure out how to properly connect and configure the OBC, and motor controller, and I'll actually be able to get the wheel spinning for the first time!
 
Back
Top