FlexiBMS Lite - New approach to get past Vaporware stage

For what it is (a copy of BK precision DC load) I’m happy with it. Displayed current and voltage readings are reasonably accurate.

One weird thing that I have detected in my use, is that the battery capacity measurement for some reason seems to be running a little too slow on the time scale. For example, the load current is 100 mA (verified by my multimeter), DC load shows around 100,8 mA, so it should be registering the correct current, but after a hour of discharge time the used capacity shows only 97 mAh on the DC load, as if the meters time keeping is running a bit slower.

I have compensated by taking timestamps of the time and current and from that calculated the real used capacity.

Apart from that it’s been good enough for my use. Personally I would upgrade or buy the 300W version, if I were to get one today. Makes getting a bit more truthful capacity measurements easier and helps locating problem spots thermal wise in battery packs.


I’m currently fine tuning the opto-isolator front resistor. The original 4k7 one was running pretty hot with 43 Volts at 60+ Celcius. 10k was a bit better at 45 C, but I think I’m gonna go a bit bigger than that.

I also tested the current consumption at 43 Volts and it slightly increased to 65 µA, but it was still very cozily under the aimed amount.

1 Like

Thanks mate. I guess that the oscillator of the main uC is off, perhaps you could try to alter the capacitance of one of them to correct it? For that you need a frequency counter.

Update:

…I went on a tangent… a deep one… Like I have a bad habit of doing :sweat_smile:

Long story about the escalation from a simple start following

bms hasn’t progressed much, so what have I been doing?Well record scratch… It all started when a colleague couple weeks ago went to go eat at a local mall on his lunch break. He then popped by an electronics/hobby/hardware/misc store (Clas Ohlson) on his way back, because they had a deal going there. For ONE euro you could buy this small, simple and cute DIY bluetooth speaker kit (shown below). He bought 5.

https://images.clasohlson.com/medias/sys_master/9630741168158.jpg https://images.clasohlson.com/medias/sys_master/9630741299230.jpg

He bought one for the office and I’m sure I looked like an excited manchild when I was assembling it (we were all making good jokes and times about it). I thought it was pretty dope, as a concept and for the price one couldn’t complain. You could power it via USB or 3 AA batteries.

Here it starts… The sound was quite tinny, no doubt in large part for the cardboard case having more holes in it than a traffic sign in Alabama. Ok, I can make a better box for it to improve the low end. Hmm… 3 AA batteries should actually be operating pretty near lithium cell voltages, let me just try it with a single 18650 cell, oh it works no problem. How much power does it use?, does some current use measurements oh this thing should last like at least 15+ hours on a single cell with decent volume… This could actually be made into a pretty sweet portable boombox with some effort…

I even looked up the ICs on the control board. Bluetooth comms were handled by Beken BK3254 ( https://oss.aliyuncs.com/netmarket/29bc7cac-8266-45bf-b2b0-f152227ba546.pdf ) and the 2 drivers were then driven by 2 MIX2052 mono channel class D amplifiers ( http://www.pluschiptech.com/web/userfiles/download/MIX2052_Prilimineary_datasheet_V1.0.pdf )

IMAG0239 IMAG0232_1

After looking at how simple the class D amp circuit was, I went onto Digi-Key to check what they had. There are many low-power class D amp ICs that can work off of a single lithium cell. Hmm… I have always been interested in getting into some audio stuff, but it has always seemed just a bit too complicated to get started, but with a single IC and just 5 external components I could have the equivalent amplification as on the original board… So I then started designing my first audio amp board… There was also some escalation on the design too and in the end it ended up getting a op-amp low-pass circuit in front of the audio amp (haven’t really worked with op-amps before, so I saw this as a good opportunity to start tinkering with them). I also LTspice simulated the low-pass behavior.

image image image

But of course, things must escalate more… I then decided that I want to charge the 1S lithium cell battery via USB and it should be protected against overdischarge, so I then started designing a single cell BMS… Which ended coming out like this.

image image

So… This 1 euro bluetooth speaker has already been escalated to 2 custom PCBs… Well we can go further than that! I then spent couple next days designing a new enclosure that fit all the original parts.

image image

I then spent couple days 3d-printing the parts and shown below is the assembled package.

IMAG0215 IMAG0216 IMAG0217 IMAG0218

There was still a small problem, it was still sounding pretty tinny (all original parts still). Hmm… I remember that Digi-Key does have some decent Peerless speakers… I guess I’ll just have little look… Oh those ones are quite cheap (7,5 € ea.), how will they work in a small enclosure though… Guess I’ll boot-up Winisd and simulate their behavior with the speaker parameters… ( http://www.loudspeakerdatabase.com/Peerless/PLS-65F25AL04-04 ). I also spent quite a lot of time just reading about speaker parameters, trying to understand their impact on the speaker behavior in different enclosures and testing my expectations through simulation.

image

Oh these ones could go decently low in quite a small volume vented enclosure… Guess I’ll order couple of those! After looking at the first enclosure for some time I decided I wanted to make a better one. I also needed to optimize the printing process at the same time. I approached the new enclosure from a different perspective.

image

And you know what. I’m pretty darn happy with it at the moment and I think it’s pretty cool.

IMAG0227 IMAG0228 IMAG0229 IMAG0230 IMAG0231 IMAG0232 IMAG0233 IMAG0234 IMAG0235 IMAG0236 IMAG0237 IMAG0238

It has good low-end for being a very portable speaker and is quite loud. Not gonna burst ear drums, but loud enough for indoor use. Once I get my custom amp boards I can tame the top-end a little bit down. But only original part left in the speaker is the bluetooth and amp PCB + speaker wires. I even changed the volume knob.

But this was my escalation story about how a “1” euro cardboard bluetooth speaker kit turned into tens of hours of development, studying, simulation and design hours… But I feel content and satisfied… for now…

TLDR: I got captivated by a 1 euro bluetooth speaker kit and spent tens of hours making “improvements” to it.


On BMS end of things… The only real thing left to do is to test the CAN bus. Opto-isolator has been tuned and tested to work from 2.8 - 50 V control signals without leaving the front resistor dissipate any crazy amounts of heat.

I’m gonna write the testing CAN libraries on the weekend and then test the comms in the office with a PC CAN adapter.

We are essentially on the final straight in the development for the 0.1 HW iteration. I have quite a list of bullet points collected on things that need changing to 0.2 and I will start implementing them once the CAN is tested and confirmed working.

13 Likes

Now that you got bitten by the DIY audio bug you won’t let go, soon you will have speakers bigger than your fridge in your living room :grin:, speaker drivers everywhere and etc

The pleasure of building a speaker and it sounding good or even better than any other you heard is priceless

If you really wanna go down the rabbit hole check out Horneresp (http://www.hornresp.net), way more advanced simulation capabilities and some crazy designs are possible

A calibrated microphone is also a must

This is one I’m working for the last year, already changed a lot of things without even finishing the first version, from passive to active and dsp driven crossover, countless Bluetooth modules

(Tweeter disconnected on this video and distortion from my phone)

On the BMS, on what version you would think to start getting beta testers?

1 Like

Once I get the obvious HW related problems fixed, then probably after I get the first small test batch from a chinese PCB+Assembly house to see if there are any problems with the DFM/MFG files.

When will that be? Can’t say, because I don’t know.

2 Likes

Finally have some intelligent life on the CAN bus!

Full CAN frame with 8 bytes of 0x55 (every bit changes state) at the correct baudrate (500kHz) IMAG0250

Some things that have been going on in the background:

  • Boarding season started 2 weeks ago, then was immediately cut off as winter made a comeback like the baddie from some bad horror film
  • My car battery gave it’s last breath of life when it decided that it wasn’t able to give enough current to even turn the engine over on a cold winter comeback morning
  • …public buses…shudder
  • My 3D-printers ATX-power supply crapped out, but I fished another one out of my old gaming rig
  • I think I got the worst of the audio bug out for now (check couple posts back for reference). Got the mono D-class PCBs assembled and tested and figured out some basics from those tests
  • STM32 Workbench decided to completely implode on me. Luckily I was able to get backups of all of my projects on it. Installed the newest one and got it set up and working, my old projects couldn’t be imported back easily though, so I now have only the FlexiBMS_lite on there
  • Had to do some studying on how the CAN bus works and especially how the registers are implemented in the STM32, but I have a pretty good grasp on it now
  • Got my Metr Pro hooked up and finally got to do a test ride with it

As for what’s next for the project. I think it’s time to start working on the 0.2 HW. Everything is pretty much tested on the HW side and all the found problems have been noted up. So I’m gonna start doing the PCB revisions next week and then once I get the boards ordered, intend to clean up all the written test code and start building more functionality onto it.

I’m gonna post a list of all the HW changes I have written down in the coming days and expect a lot of pictures.


CAN bus technical discussion

CAN bus grounding? Is it necessary, or will it create mustard gas :thinking:?

Let’s take a look at connecting multiple VESCs together, it’s a surprisingly opinion dividing topic on how it’s best to connect them together. Hence there is a thread with nearly 300 replies on this particular matter:

But this isn’t about that PPM Y-split vs. CAN discussion. This is about that third signal wire that is awkwardly hanging around like your old Ex (GND) in the background as you’re going on a date with your new girl (CANH & CANL)… Sometimes you just wonder if you would’ve been better staying with her or if you should try to ask her to a threesome…

So, innuendos aside. There are 3 possible ways to do grounding in CAN bus associated communication and all can be summarized easily in this easy-to-understand memetic image.

Image

image

In practice, all CAN transreceivers need to be in within a certain range for common-mode voltage swing, AKA in relation to ground. Even though the data carrying signals CAN HIGH and CAN LOW are differential for better signal integrity and noise immunity.

In the official CAN Bus standard (ISO 11898-2) this common mode offset-voltage is specified as: image

But available ICs can support much larger common mode offset voltages like the TJA1051 at ±30V: image

But I think it makes more sense to look at the question with the 3 possible grounding strategies:

  • No CAN ground
  • Weak CAN ground
  • Strong CAN ground

Then ask the question how far can the Grounds of 2 or more CAN transceivers be offset at worst case or at least in normal operation:

If there should be no reason for large ground offsets, there is no need for dedicated CAN ground. The shared system ground will be good enough. This in my opinion mirrors the most common use case in esk8ing with 1 battery pack powering all ESCs and therefore supplying a strong ground with the power lead harrness. Pictured below is my board’s VESC setup with a clearly strong system grounding, meaning there is no need for the CAN ground connection between the VESCs (and in fact should not be used to avoid ground loops).

IMAG1109

Strong CAN grounding should be used if multiple ESCs were powered from 2 or more separate battery packs, AKA pack #1 only powers ESC #1 and pack #2 only powers ESC #2, as in this case there is no common ground shared between the 2 CAN trans-receivers on the ESCs, causing them to be floating in relation to one another. The better place to do this grounding would be to connect the ground of the battery packs together in my opinion. A strong grounding can be used, because the ESCs don’t share the ground currents and this goes for multiple floating devices, they need to be tied together in some way.

Weak grounding should be used if the devices share a common ground, but for one reason or another can exhibit large ground voltage swings. Strong grounding can cause large ground currents to travel through the CAN’s Ground if that pathway is presenting a lower impedance to the system ground. Weak CAN Ground will present much larger grounding impedance to lower the possible ground currents to a much lower level, and therefore lowering the voltage drop on the CAN Ground line, more likely staying within the maximum offset voltage. I’m not quite sure if the better idea would be to add a resistor in-line to the CAN Ground wire, or between the CAN transceiver’s ground pin and device ground.

But there. That went on a bit longer than I intended, but hopefully what I wrote made sense and that I had correctly understood what I had read and studied.

8 Likes

I assume it’s not an issue to charge with a less of a current? 12s 10a chargers don’t come cheap.

Not a problem at all. It just means that your charge time will be longer. In saying that max charge rate depends on your pack configuration anyway.

1 Like

Changelog 0.1 -> 0.2 HW iteration:

  • Connect BOOT0 pin to GND (pin left floating read as a logical “1”, causing weird behavior in boot, band aid fix done by writing nSWBOOT0 to “0”)
  • Capacitor values for MCU and linear regulators 1µF
  • MCU linear regulator switch from AP2210N-3.3 to TS9011SCX (for lower quiescent current consumption)
  • Breakout pad for 5V
  • Reset breakout pad
  • Finetune LTC6803 footprint (increase pad length slightly)
  • Add BAS20 diode to the LTC6803’s linear voltage regulator output
  • Lower balancing current (change resistors from the initial 33R to 47R due to thermal performance. Balance current changing from 125mA to 88mA)
  • Fix Q3 and Q4 mix-up at the battery Vsense (accidentally put the wrong fet types the wrong way)
  • Change charger sense pin to one with analog connection (fix already described on post #105)
  • Change opto-isolator footprint to correct one (used a bit too big one)
  • Charging FET change from DMT6016LSS-13 to DMT6004LPS-13 (in effort to achieve 10A sustained continuous charging current)
  • Charging current sense trace isolation (currently the sense trace shares ground return currents, causing higher than real current measurement results)

That is everything I have noted in my hardware assembly, testing and discussion in this thread. Most of these changes are quite minute, not really needing huge layout changes on the board, so implementing these changes/fixes shouldn’t take that long.

If somebody has questions about the change list, this would be the best idea to present them.

3 Likes

Remembered one thing I hadn’t test yet, which was the RGB indication led on the board. Made couple short clips of it in action.

gif

I have finished the 0.2 HW changes and I’m going to order the new PCBs this week.

image

6 Likes

How thick is the BMS with plugs and sockets?

I’m thinking having cables coming out both sides uses a lot of room up compared to how small the BMS is. Is it possible to raise up and spin the connectors on one side 180 deg with out the thickness exceeding 18mm (diameter of a 18560 cell) this would allow cables to be routed down 1 side layered on top of the other ones. Reducing the space you would have to dedicate to the BMS inside a build ones it’s has all its connections attached.

It’s just a idea and I have no idea if this would cause to much mechanical stress or heating issues by doing some thing like that or if it need covering with fish paper or some thing so resistors don’t melt and short cables. Or any other issue that may arise from doing that others might foresee.

Edit: This would all depend if you place you BMS next to or on top of your battery I suppose.

1 Like

@SimosMCmuffin this legitimately looks amazing. The layout and design in general looks.awesome! I’m so thirsty for one of your finished products.

@Darkie02 the connectors are place like that so that there Is a battery side and a board side. All the relevant battery connectors are on one end - balance and power. And the other side is all the external inputs and outputs -can charge leads etc. Makes a lot of sense to be like this if you ask me.

1 Like

Appreciated.

^This

@Darkie02 The board should be under or just about 18mm thickness even if you’re using the vertical connectors and have the JST-XH balance connector plugged in with wires connected. You might need to bend the wires of on the XH quite tightly though.

If space is on super premium then you can remove connectors (or order the board without them) and solder your wires directly onto the board.

Below are top and bottom pictures of the board with the connectors named. Feel free to ask, if there is still something unclear.

EDIT: I’m gonna finish the board today and order the PCBs

14 Likes

As always, I love this project and has been following since the beginning of the Full version. Can’t wait to use it once it is finished.

2 Likes

0.2 PCBs have been ordered.

Also noticed this very interesting update email in my mailbox from Seeedstudio, I might take a further look into this.

7 Likes

PCBs are here. No major difference in the looks, but I also got some XT30s and I would say they are pretty ideal and just so cute next to their XT60 big brother.

IMAG0270 IMAG0271

I’m gonna do inventory on the components tomorrow and order what I’m missing for the next week. I think I might be able to start the assembly, but won’t be able to finish it this weekend.

15 Likes

This is looking great. cant wait to get my hands on one of these :slight_smile:

Don’t know if it would work with the lay out but I quite like these.

image https://ae01.alicdn.com/kf/HTB1ra_.KFXXXXbMXVXXq6xXFXXXY.jpg

3 Likes

Got the parts ordered and I’m working on the code at the moment. Cleaning up the functions and making things more clear and efficient to run.

4 Likes

Decided to do some destruction as a way to end the weekend.

IMAG0272 IMAG0273 IMAG0274 IMAG0275 IMAG0276 IMAG0277

Solder joints failed on the vertical one, while the horizontal one tore the copper pads off of the board. It did take some torque to get these off. The XT30s themselves were alright and still connected nicely after this.

Note: No 0.2 PCBs were hurt in the making of these photos. Only old 0.1 boards.

5 Likes