New BMS for bq76PL455A based batteries

Topics concerning OEM and open source BMSes
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

Sorry not very clear, obviously need to move to a 5V transceiver too!
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

Pete9008 wrote: Sat May 14, 2022 6:09 pm Probably something like a SN74LVT1T34 for the Rx line (or similar, not my first choice but they were all that was in stock when I checked a few weeks ago). For the Tx and enable you'll probably find that the Pico 3V3 high level is fine, let me find the datasheet.
Sorry, typo SN74LV1T34DBV
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

Just had a quick look and can't find stock of anything suitable now.

It's a fairly nasty solution at these frequencies but a resistive divider should work for Rx, just keep the resistor values low so that RC (where C is the circuit parasitics) is much lower than the signal pulse width and ideally lower than the max rise time, if specified, for the receiving chip (can't find it for the RP2040 but given the input has metastability latches and schmitt inputs it should be fine).

Say 20pf (probably lower in reality) and RC < 50ns gives a max R of 2k5 so say a 1k and a 2k. Should be possible to bodge them onto an existing board to try it without a respin too if you can find a 5V transceiver.
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

Pete9008 wrote: Sat May 14, 2022 6:41 pm Should be possible to bodge them onto an existing board to try it without a respin too if you can find a 5V transceiver.
Unfortunately I think this might be too much bodge. I'd need to swap in resistive dividers on the two data pins, and a 5v supply, not totally impossible for testing, but probably worth just ordering a new board.

Edit: only one data line, and the driver VCC line, and the pull up resistor, not totally inconceivable.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

It's not too bad to do, I wouldn't do it on a production board but for testing it's ok. I've recently done the same mod on a 5V CAN transceiver to allow it to work with a 3v3 Arduino board (just tried to take a picture but can't get the camera to focus clearly enough to show it). I normally cut a track, scrape back the solder resist and lay the series resistor across the gap and then find somewhere from the 3v3 side of the track to the ground plane for the parallel resistor. If done neatly it's hard to tell it is there.

For the 5V I'd expect to lift the IC pin and run a mod wire unless there is a convenient place to cut a track (later has the advantage that it keeps the decoupling cap on the IC).

The main problem with the resistive divider is the power consumption, to get the high frequency performance it needs to have low R values which means mA currents going through it which ruins your standby power consumption - but it's good enough for validating a design. There is a really nasty hack which just uses the series resistance to limit current and then relies on the receiving IC protection diode to clamp the voltage - in theory it works but I've never used it.

There are a number of other level translator circuits using FETs or diodes but they often don't perform well at higher frequencies. The best way is to use a translator which gives low power and clean/fast rising and falling edges. You can either use a dedicated one, like the one mentioned, or a logic gate from a family that has 5v tolerance, seem to remember using LVC and VHC families in the past.
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

I think I'll spin a new board.
Screenshot at 2022-05-15 09-49-49.png
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

Looks good.

I forgot you have three channels to do, could also use something like a vhc125, cheaper and available but older generation family so slightly higher supply current (afraid I'm not up to date with newer equivalent logic families). Might not work quite as well with the existing board layout/routing though?
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

Pete9008 wrote: Sun May 15, 2022 9:27 am Looks good.

I forgot you have three channels to do, could also use something like a vhc125, cheaper and available but older generation family so slightly higher supply current (afraid I'm not up to date with newer equivalent logic families). Might not work quite as well with the existing board layout/routing though?
Thanks, I think I'll use the three small shifters though, definitely fits better with the "modular" layout.
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

I've ordered a new board with the 5V drivers. Fingers crossed!

Latest schematic here: https://raw.githubusercontent.com/catph ... ti-bms.pdf
ti-bms.png
It occurs to me that there is another improvement that could be made. I'm not inclined to do so on my board at this late stage but for a redesign, I would consider tying RE and DE together, and putting a pull-up on RO. This does 2 things:
1) Frees up a GPIO per transceiver!
2) Disables RX when transmitting, no PIO JMP needed!

Edit: Remembered why I didn't do this originally, the board has a low power sleep mode that shuts down both the TX and RX.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

That had me worried for a minute, from the render it looked like the chokes were in the wrong way round :o

Just checked the PCB and it's fine though :-)

Where did you find stock of the ICs?
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

Pete9008 wrote: Sun May 15, 2022 4:57 pm That had me worried for a minute, from the render it looked like the chokes were in the wrong way round :o

Just checked the PCB and it's fine though :-)

Where did you find stock of the ICs?
Yes, for some reason I mounted the chokes sideways. I think at some point I must have been extremely tight on space, and it stuck.

It's all JLCPCB. They have stock, but prices are through the roof. £160 GBP for 5 boards. I really hope they work!
Attachments
Screenshot at 2022-05-15 18-10-51.png
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

catphish wrote: Sun May 15, 2022 5:12 pm £160 GBP for 5 boards. I really hope they work!
Ouch! fingers crossed.

Must admit I really dislike respins and have always aimed for working first time even if it means a slower design stage. I've surprised myself on a few occasions on complex boards that have worked first time! (unfortunately also had a few obvious, stupid mistakes scrapping boards).

Not used JLCPCB before, they seem highly regarded here and the prices do look very competitive. Going to give them a try for my next boards though (have had to go multilayer which really precludes any UK places price wise).
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

Pete9008 wrote: Sun May 15, 2022 5:29 pm Ouch! fingers crossed.
New boards arrived yesterday, had a chance to test this morning and the difference with the 5V drivers is substantial. I am now getting around 50% failures with *this* wiring setup (and obviously none with a sensible 2m cable).
PXL_20220524_114246352.jpg
Looking on the scope, I now see strong 10V transitions.
PXL_20220524_115212140.jpg
There is clearly a drift towards 0V when the battery transmits (the last of the 7 bursts), because the battery doesn't have nearly as much drive strength as my board does (because it has 1nF capacitors). I'm not worried about this though as it stays well within a detectable range, and the zener diodes limit the effect substantially. This is the data as seen at the RS422 chip. The differential voltage gets as low as 2v.
PXL_20220524_120935962.jpg
I think the only way this could be improved further would be to use a higher impedance RS422 chip and increase the value of the pull resistors.
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

I decided to try one more change... I replaced the 1k pull resistors on the new board with 4k7. This makes a marginal improvement to performance but a *dramatic* improvement to how things look on the scope. I think we can call this a success.
PXL_20220524_150209197.jpg
PXL_20220524_141916258.jpg
Reworking 30 resistors across my new batch of boards will be boring, but worthwhile I think. Communication on the long coils of wires is still marginal.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

catphish wrote: Tue May 24, 2022 12:04 pm New boards arrived yesterday, had a chance to test this morning and the difference with the 5V drivers is substantial.
Great news!

Signals look MUCH better, especially the last ones :-)

Are the scope plots with the coils or twisted pair? I'm guessing the later as they look too good to still be getting errors (what kind of errors were you seeing, missed messages or corruption?).

Be careful using the coils, the L could easily be resonating with the series C giving wildly varying results for relatively minor setup changes.

If that message length is typical I wouldn't have any concerns about those signals at all now. Looking much more promising for comms to work with the inverter running too.
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

Pete9008 wrote: Tue May 24, 2022 4:20 pm Signals look MUCH better, especially the last ones :-)

Are the scope plots with the coils or twisted pair? I'm guessing the later as they look too good to still be getting errors (what kind of errors were you seeing, missed messages or corruption?).

Be careful using the coils, the L could easily be resonating with the series C giving wildly varying results for relatively minor setup changes.

If that message length is typical I wouldn't have any concerns about those signals at all now. Looking much more promising for comms to work with the inverter running too.
Those scope traces are all taken with a 1m twisted pair. I believe you're right about the coils. When testing with them, things certainly seemed unpredictable. I'll see if I can find a longer length of twisted pair to do a more controlled test.

Bytes are always 8-9 bits long, multi-byte messages can have a significant gap between bytes. The bq76PL455A leaves long gaps between bytes (much longer than I do, and easily long enough for the line to return fully to idle) so perhaps I will do the same. Note: in my screenshots, you always see a couple of bytes of my request then one byte of reply. In fact there will always be more bytes of reply, they just come significantly later.

With the final setup (driving at 5v with 4.7k resistors), the errors I was seeing were a mix of RX CRC errors, and not getting a reply at all (which I would attribute to the bq76PL455A detecting a CRC error in my request. This is exacty what I'd hope for in the case of a bad cable, suggesting that neither end in particular is doing anything wrong.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

That all sounds good, agree that a mix of lost Tx and Rx is a good sign.

Ethernet cable should work if you have any?

Look forward to hearing how it works on the car/s.
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

Pete9008 wrote: Tue May 24, 2022 5:38 pm Ethernet cable should work if you have any?
Just tested with 20m (!) roll of Ethernet cable. Results are extremely interesting. Now 100% of requests receive a complete response with CRC errors. If I ignore the CRC checks, the data is all there but clearly corrupted.

Thinking about this, I actually prefer this result to the previous one. My isolation capacitors are 10x larger than those at the other end, so I'd expect cable capacitance to affect data I send much less than data the other end sends. The coils I was using previously must have been causing their own problems.

I don't really want to start cutting up this cable to work out the maximum length, but I'd say things are definitely working well now.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

catphish wrote: Tue May 24, 2022 5:53 pm Just tested with 20m (!) roll of Ethernet cable. Results are extremely interesting. Now 100% of requests receive a complete response with CRC errors. If I ignore the CRC checks, the data is all there but clearly corrupted.
That's a great result!
catphish wrote: Tue May 24, 2022 5:53 pm My isolation capacitors are 10x larger than those at the other end, so I'd expect cable capacitance to affect data I send much less than data the other end sends.
Agree, the load impedance difference at the two ends will be causing an imbalance too. Also bear in mind that with 20m of cable it will be starting to look more like a transmission line than a lumped component equivalent, and with being unterminated it will have all sorts of interesting resonances of its own too!
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

Just wanted to provide an update on this. The latest version of the BMS worked well, but today I actually got all the high voltage live in my car and discovered a fairly substantial problem. The charger generates high frequency noise (I assume due to PWM) in the high voltage system. This noise comes straight through the data lines and completely breaks the comms. My assumption is that there's some kind of coupling in the charger between the HV and GND. Regardless of the reason, there seem to be high frequency noise that is too much for the choke and differential receiver to eliminate. I'm not completely sure how to proceed with solving this yet. It's been suggested by celeron55 that this daisychain protocol is designed with the assumption that the absolute voltage differential between devices will be minimal, where in reality I probably have a huge voltage differential between HV+ and LV GND.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

Is it just the charger that causes the problem or is it also the inverter?

If it's just the charger then would it be worth looking at adding additional filtering to the charger output? Have you captured any scope plots of the noise?
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

Couple more thoughts on this.

I'm guessing that your charger is effectively putting noise between the battery pack and car chassis/ground (common mode on pack pos to neg but differential between pack and car chassis). In this case filtering on the charger output would be difficult without affecting the pack isolation.

My guess is that the pack to pack comms is fine but it's just the link from the last pack module to your board that is the problem - because your board is referenced to chassis ground rather than pack 0V it's providing a capacitively coupled earth path for all the HF noise. If so the way to fix it is to allow your module to float with the pack and then provide low capacitance isolated comms/power on the CAN bus side. The way to test this would be to battery power your module and to log locally while charging to see if it is then working. If it is you can then look at isolating the power and CAN bus comms to let it float normally.

Edit - another thought - does your charger have/need a good chassis earth (the aluminium chassis on your car could make getting a good connection problematic)?
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

Pete9008 wrote: Tue Jul 05, 2022 5:30 am Is it just the charger that causes the problem or is it also the inverter?
This *does* also happen when the inverter is running. I'm not 100% sure what this means, but I definitely think you're correct that the next step is to try running the board from a battery powered laptop USB. Actually isolating the board from low voltage will be a bit of a hassle :(
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: New BMS for bq76PL455A based batteries

Post by Pete9008 »

Not sure a laptop will be good enough to prove whether or not it is the problem, potentially a bit too much parasitic capacitance but worth a try. Be careful though, you are just relying on the series caps for isolation. Could you literally battery power it and just use something like an LED to indicate whether the comms are working (or is it buried in an inaccessible location in the battery box?).

Sorry, I probably should have seen this coming, it seems so obvious now you've found it.
User avatar
catphish
Posts: 954
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 93 times
Been thanked: 179 times

Re: New BMS for bq76PL455A based batteries

Post by catphish »

It is buried in the battery box, but I have more boards, so the easiest thing is to use a spare board externally for testing. There is an LED on the board which could be programmed to indicate communication success, good idea. I'll have a play with this later in the week.
Post Reply