FlexiBMS Lite - Flexible Configuration BMS w/ CAN-bus

FW:0.10
$0=12 (Pack cell count; number of series cells in the battery pack, set to 0 to disable cell sensing, Uint)
$1=10000 (Max charging current; mA (milliAmps), maximum current allowed to flow to battery, Uint)
$2=300 (Charging termination current; mA (milliAmps), stop charging when current drops below this, Uint)
$3=2000 (Minimum cell voltage; mV (milliVolts), minimum allowed cell voltage, no charging allowed if cell voltage below this, Uint)
$4=4250 (Maximum cell voltage; mV (milliVolts), maximum allowed cell voltage, no charging allowed if cell voltage above this, Uint)
$5=10000 (Minimum charger voltage; mV (milliVolts), minimum allowed charger voltage, no charging allowed if charger voltage below this, Uint)
$6=55000 (Maximum charger voltage; mV (milliVolts), maximum allowed charger voltage, no charging allowed if charger voltage above this, Uint)
$7=7000 (Minimum pack voltage; mV (milliVolts), minimum allowed pack voltage, no charging allowed if pack voltage below this, Uint)
$8=52000 (Maximum pack voltage; mV (milliVolts), maximum allowed pack voltage, no charging allowed if pack voltage above this, Uint)
$9=4180 (Charging cell termination voltage; mV (milliVolts), don’t allow any cell to go above this voltage when charging, Uint)

$10=50400 (Charging pack termination voltage; mV (milliVolts), don’t allow pack to go above this voltage when charging, Uint)
$11=4150 (Cell balancing voltage; mV (milliVolts), allow balancing once a cell goes above this voltage, Uint)
$12=10 (Allowed difference between cell groups; mV (milliVolts), maximum allowed voltage difference between cell groups, balance if difference bigger, Uint)
$13=0 (Minimum external NTC thermistor temperature; K (Kelvin), set to 0 to disable, if enabled, the minimum temperature above which charging is allowed, Uint)
$14=0 (Maximum external NTC thermistor temperature; K (Kelvin), set to 0 to disable, if enabled, the maximum temperature below which charging is allowed, Uint)
$15=260 (Minimum PCB temperature; K (Kelvin), the minimum temperature above which charging is allowed, Uint)
$16=330 (Maximum PCB temperature; K (Kelvin), the maximum temperature below which charging is allowed, Uint)
$17=0 (0/1, allow cell balancing outside of charging, Boolean)
$18=30 (Fault wait time; s (seconds), How long to wait after fault state before trying to start charging again, Uint)
$19=1.0178 (Gain for Battery voltage ADC conversion, Float)

$20=0.0 (Offset for Battery voltage ADC conversion, Float)
$21=1.0265 (Gain for Charger voltage ADC conversion, Float)
$22=0.0 (Offset for Charger voltage ADC conversion, Float)
$23=1.0139 (Gain for Current sense ADC conversion, Float)
$24=0.0 (Offset for Current sense ADC conversion, Float)
$25=1.0000 (Gain for External NTC temperature probe conversion, Float)
$26=0.0 (Offset for External NTC temperature probe conversion, Float)
$27=1.0000 (Gain for Internal MCU temperature conversion, Float)
$28=0.0 (Offset for Internal MCU temperature conversion, Float)
$29=3380 (External NTC probe Beta-value; external NTC sensor’s beta value, Uint)

$30=16 (ADC’s oversampling setting; allowed values (1, 2, 4, 8, 16), Uint)
$31=100 (h (Hours), how long to stay in active mode, Uint)
$32=0 (0/1, force 5V regulator always on when battery connected, Boolean)
$33=3 (balancing temperature ratio, dynamically adjusts the max allowed balancing resistors based on BMS temperature, set to 0 to use static maximum, Uint)
$34=3800 (Storage discharge voltage; mV (milliVolts), if storage discharge enabled, then pack will be discharged to this voltage, Uint)
$35=0 (h (Hours), how long to wait from last CHARGING event to start discharging the pack to the storage voltage, set to 0 to disable, Uint)
$36=0 (0/1, CAN activity status LED tick, good for testing that the BMS is receiving CAN traffic, Boolean

1 Like

I’d recommend updating to 0.17c as the first step, as there has been some improvements and fixes to the charging algorithm and this would at least eliminate FW being problem source.

1 Like

Okay, let’s do some multimeter measurements.

Before disconnecting the battery pack, measure the voltage from between the 2 Mosfets, against ground. And from charger + pin to GND.
image

Then plug in the USB, start logging and disconnect balance connector and then pack terminal and post the log.

Disconnect USB, so the BMS is completely unpowered.

Then measure resistance from B+ and C+ to the middle of the Mosfets and repeat same with diode measurement mode. Take note of the positive probe and negative probe.

image

EDIT: Also, when you connect your charger to the BMS, do you first connect the charger’s cable to the BMS and then power-up the charger or do you first plug the charger into the wall socket and then connect it to the BMS. Aka, are you hot- or cold-plugging it to the BMS?

2 Likes

Thanks. I’ll do that tomorrow.

The latter. I believe that’s the best practice.

5 Likes

Try new firmware and if it dont work:
$5=47000

1 Like

I’d personally disagree, as you’re connecting a charger with the connector already at output voltage (12S charger → ~50V) to the C+ input on the BMS (that should be near 0V) and this might cause a current-rush event and then a voltage spike due to stray inductance that can go over the 60V abs. max limit of the charging Mosfets.

This is my theory at the moment for why you see a constant 12V on the charger side, as I believe one or both Mosfets have taken some repeated electrical beating and slightly “leak” in reverse direction now, if you have been doing this always when connecting the charger, especially at 12S voltages (not that I have warned against doing this either, so I can’t say “user error RTFM”).
After thinking about it, I find it quite possible for the 50V charger to cause a short voltage spike at the charging Mosfet that would go over it’s 60V rating, it might not immediately kill it, as the actual duration of the spike can be in the nano- to microseconds in length, but over time it’s like chipping at a brick wall with a tool and it slowly gives away, at some point light will start peeking through a hole you’ve made. There isn’t a loud spark as you connect the connector due to the input capacitance on the C+ pin being very small, but there is still short a current-rush event, just like if you connect a battery pack to an ESC without an anti-spark switch.

I believe I have personally always plugged in the charger connector first and then powered the charger up in my personal use and testing, so I haven’t come across this particular failure mode. When you plug in the charger first and then power it up, it brings up the voltage more gradually with a soft-start, usually lasting a few milliseconds, so it is much more “gentle”.

With the multimeter readings, I should be able to see if one or both of the Mosfets are about to go or if my theory is incorrect.

3 Likes

Updated, will try again tonight.

Parameters

$0=12 (Pack cell count; number of series cells in the battery pack, set to 0 to disable cell sensing, Uint)
$1=6500 (Max charging current; mA (milliAmps), maximum current allowed to flow to battery, Uint)
$2=300 (Charging termination current; mA (milliAmps), stop charging when current drops below this, Uint)
$3=2000 (Minimum cell voltage; mV (milliVolts), minimum allowed cell voltage, no charging allowed if cell voltage below this, Uint)
$4=4250 (Maximum cell voltage; mV (milliVolts), maximum allowed cell voltage, no charging allowed if cell voltage above this, Uint)
$5=10000 (Minimum charger voltage; mV (milliVolts), minimum allowed charger voltage, no charging allowed if charger voltage below this, Uint)
$6=55000 (Maximum charger voltage; mV (milliVolts), maximum allowed charger voltage, no charging allowed if charger voltage above this, Uint)
$7=7000 (Minimum pack voltage; mV (milliVolts), minimum allowed pack voltage, no charging allowed if pack voltage below this, Uint)
$8=52000 (Maximum pack voltage; mV (milliVolts), maximum allowed pack voltage, no charging allowed if pack voltage above this, Uint)
$9=4180 (Charging cell termination voltage; mV (milliVolts), don’t allow any cell to go above this voltage when charging, Uint)

$10=50400 (Charging pack termination voltage; mV (milliVolts), don’t allow pack to go above this voltage when charging, Uint)
$11=4150 (Cell balancing voltage; mV (milliVolts), allow balancing once a cell goes above this voltage, Uint)
$12=10 (Allowed difference between cell groups; mV (milliVolts), maximum allowed voltage difference between cell groups, balance if difference bigger, Uint)
$13=0 (Minimum external NTC thermistor temperature; K (Kelvin), set to 0 to disable, if enabled, the minimum temperature above which charging is allowed, Uint)
$14=0 (Maximum external NTC thermistor temperature; K (Kelvin), set to 0 to disable, if enabled, the maximum temperature below which charging is allowed, Uint)
$15=260 (Minimum PCB temperature; K (Kelvin), the minimum temperature above which charging is allowed, Uint)
$16=330 (Maximum PCB temperature; K (Kelvin), the maximum temperature below which charging is allowed, Uint)
$17=0 (0/1, allow cell balancing outside of charging, Boolean)
$18=30 (Fault wait time; s (seconds), How long to wait after fault state before trying to start charging again, Uint)
$19=1.0000 (Gain for Battery voltage ADC conversion, Float)

$20=0.0 (Offset for Battery voltage ADC conversion, Float)
$21=1.0265 (Gain for Charger voltage ADC conversion, Float)
$22=0.0 (Offset for Charger voltage ADC conversion, Float)
$23=1.0139 (Gain for Current sense ADC conversion, Float)
$24=0.0 (Offset for Current sense ADC conversion, Float)
$25=1.0000 (Gain for External NTC temperature probe conversion, Float)
$26=0.0 (Offset for External NTC temperature probe conversion, Float)
$27=1.0000 (Gain for Internal MCU temperature conversion, Float)
$28=0.0 (Offset for Internal MCU temperature conversion, Float)
$29=3380 (External NTC probe Beta-value; external NTC sensor’s beta value, Uint)

$30=16 (ADC’s oversampling setting; allowed values (1, 2, 4, 8, 16), Uint)
$31=100 (h (Hours), how long to stay in active mode, Uint)
$32=0 (0/1, force 5V regulator always on when battery connected, Boolean)
$33=3 (balancing temperature ratio, dynamically adjusts the max allowed balancing resistors based on BMS temperature, set to 0 to use static maximum, Uint)
$34=3800 (Storage discharge voltage; mV (milliVolts), if storage discharge enabled, then pack will be discharged to this voltage, Uint)
$35=0 (h (Hours), how long to wait from last CHARGING event to start discharging the pack to the storage voltage, set to 0 to disable, Uint)
$36=0 (0/1, CAN activity status LED tick, good for testing that the BMS is receiving CAN traffic, Boolean)
$37=10 (CAN ID number for this BMS unit, if using multi-BMS setups, all BMS’ need to have unique CAN ID, uint16_t)
$38=0 (0/1, if set to 1, keeps 5V regulator on if activeTimer is not expired even if USB, charger or Opto not active, Boolean)
$39=0 (h (Hours), up to how many hours a CAN-frame reception can extend activeTimer, set to 0 to disable, uint16_t)

Edit, i am using a 10 Amp charger, so will likely bump my my $1 up

Interesting. I would swear that I have read in multiple user guides to various electronic devices that you should always plug the adapter into the mains first and only then connect it to the device so that’s what I’ve been doing most of my life. I’ve done some quick googling now and most of the resources say that it either doesn’t matter or it’s better to connect to the device first. I must have been doing it wrong all my life then. :slight_smile:

I’ll get back to you with the measurements.

5 Likes

On this very forum I’ve read advice that it’s best to plug the charger into the wall first, just for the reason that a shitty charger that decides to blow up might short your battery as well if it was already plugged into the board. Might not kill the battery, but could kill your BMS or ESC, if it was turned on. :man_shrugging:

It would suck if our BMSes had to be as resilient as our antisparks…

1 Like

If you’re using 10 Amp charger, then also bump $1 (maxChgCurr) higher, or it’ll trigger a overcurrent fault and stop charging, I’d try $1=11000 as a starting point.

Let’s see how things look like.

1 Like

I’d recommend a fuse to protect against this, as this is a big fault event.

2 Likes

I was also doing this always, but thinking on @SimosMCmuffin explanation, with Flexi and other BMS that actually control the charging, I agree that it is better to first plug the charger on the board and then on the wall and will be doing that

If you don’t have a BMS that first verify things and then allow charging, first plugging into the wall and then on the board would be better, given that the charge port is always live and you would instantly charge the charger capacitors with a high current that may damage the connectors over time

The problem now will be to remember to do it different for each board

1 Like

Inductive spikes are pretty much analogous to the water hammer phenomenon in hydraulic systems.

Voltage = Pressure
Current = Flow rate
Resistance = Flow restriction
Inductance = Water wheel
Capacitance = Pressure membrane

5 Likes

But how the 5V power supply would be powered ?
By the discharge path, wouldn’t be ?
It assumes then than both ESCs will be also powered.

Ideally, if a system needs true isolated communication bus. You would have a real isolated power supply in one place from where you can continuously provide isolated supply voltage and then run all the bus-side communication transceivers from that. This would be a real industrial approach to the situation, but at least in the size constraints of the Lite model, there isn’t space to pack a transformer based isolated power supply. And the isolated power supplies usually have pretty bad efficiency, so battery conservation is compromised and if you shut down the isolated power supply, well then you have completely un-powered the whole bus-side supply.

This approach however assumes that all the transceivers are isolated on the bus-side, as otherwise you if you connect the bus-side to the system ground, it’s now referenced to a ground somewhere and common-mode restrictions are back and referenced to that.

1 Like

I never saw that in the industry regardless the field bus used (Devicenet, Profibus, ASI, modbus…).
And there is a LOT of EMI around !
That’s why I’m wondering why we can’t have such a reliable bus in our eskate without the need to deal with external power supply (which IMO makes it no more a “bus” in its philosophy). :man_shrugging:

Thanks for the feedback guys. I used IC like SN6501 from TI and associated transformer for isolation purpose like shown above, but this is not an option for this application because of size & cost.

So, the option left if ground loop becomes a problem under high discharge is to leave GND unconnected on the CAN bus between controller & BMS. Adding ESD might do the job for protecting against spikes on the bus.

If you fuse your charge ports, this failure mode doesn’t exist, for the most part.

1 Like

So, tried again, no dice. Would you like to take this PM, or should we continue trouble shooting here?

1 Like

You can DM me with more specifics if you have questions or need help. I’ve written both canbus (arduino) and bluetooth mobile apps (Flutter aka cross platform) that communicate with the bldc firmware. I’m no BV but I know quite a bit. It’s all open source on my github.

3 Likes