o-gs / dji-firmware-tools

Tools for handling firmwares of DJI products, with focus on quadcopters.
GNU General Public License v3.0
1.52k stars 420 forks source link

Battery firmware #17

Open notsolowki opened 7 years ago

notsolowki commented 7 years ago

i notice the battery firmware is not encrypted. i wonder what could be done to the battery controller so aftermarket batteries could be connected

rokz12 commented 3 years ago

Hi all built this a few weeks ago and working well for low capacity cells....just waiting for new cells.Even charges on dji charger IMG_20210417_165237

svarteld commented 3 years ago

@0r10nV thanks! @rokz12 looks like 18650 x12, right? Did you use regular cells, or the high voltage versions? I've not found both high current and high voltage 18650's. What cells did you order? More details on your battery would be interesting.

Seems possible to cram 12x 20700 cells if you ditch the battery basket and attach them to the top only, possibly with a problem with the total height of a couple of mm (see the non-contained pack in my picture above, with 21700 cells; 20700 will be more reasonable).

rokz12 commented 3 years ago

Hi just trying to figure out github as never really use it....

On Thu, Apr 22, 2021 at 3:51 PM svarteld @.***> wrote:

@0r10nV https://github.com/0r10nV thanks! @rokz12 https://github.com/rokz12 looks like 18650 x12, right? Did you use regular cells, or the high voltage versions? I've not found both high current and high voltage 18650's. What cells did you order? More details on your battery would be interesting.

Seems possible to cram 12x 20700 cells if you ditch the battery basket and attach them to the top only, possibly with a problem with the total height of a couple of mm (see the non-contained pack in my picture above, with 21700 cells; 20700 will be more reasonable).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/o-gs/dji-firmware-tools/issues/17#issuecomment-824910836, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXC56QBZ3UPGT32YGBDATDTKAZWZANCNFSM4C7QHINQ .

rokz12 commented 3 years ago

Hi i did use ur18650rx as a test ....Have bench tested with high power discharger and works fine temp ect did decide to charge with dji charger.App seams to have no issues and seams correct values.ur18650rx family of cells do have some that charge to 4.30 so i took a gamble with no adverse affect not even temperature !.Just waiting for higher capacity cells for testing....!

rokz12 commented 3 years ago

Would like to adjust firmware for newer cells !.Did notice when testing on discharger for capacity with original tb47 the voltage actually dropped below 20 volts and did not automatically switch off....this could be a bonus considering the power curve of these cells

svarteld commented 3 years ago

@0r10nV, don't know if you've meant charging each 18650 cell detached individually in a regular LiPo charger, or attaching the LiPo charger to the TB47, but I've tried; TB47 BMS don't mind being fed with lower voltages (4,2V x6) than stock DJI chargers (4,35V x6), so guess I'll charge the 18650 modded TB47's via LiPo charger via the BMS, see image. x

0r10nV commented 3 years ago

don't know if you've meant charging each 18650 cell detached individually in a regular LiPo charger, or attaching the LiPo charger to the TB47,

of course through the battery connector and bms, selecting [6S LiPo no-balance] profile in the smart charger settings, basically like you did it.

Did you use regular cells, or the high voltage versions? I've not found both high current and high voltage 18650

Yes, they don't produced for mass market. There are 4.30V low rated or 4.2V high rated samples from different vendors but not both features available in one cell. Looks like technology restrictions.

rokz12 commented 3 years ago

Love your T200.i charged the battery as normal with the standard dji charger do like to use sanyo/panasonic cells a i believe they leave room for overcharging without adverse effect....well short term.might loose cycle life a bit

0r10nV commented 3 years ago

do like to use sanyo/panasonic cells a i believe they leave room for overcharging without adverse effect

If they are 4.30v cells then they should withstand small overcharging to 4.35, but they are no high rated for discharge. They are for laptop batteries which consume much less current then drones.

By the way, Could you measure full battery voltage at the end of charge using TB47 DJI charger?

rokz12 commented 3 years ago

I am using ur18650rx high discharge cells but low capacity and fully charged show 4.29 just to test to see if need external charger or can i use dji charger.Ie yes overcharged !.Have cycled 2 now and not getting hot.Waiting to get some high capacity cells shortly

OlliDXD commented 3 years ago

Fixed up two dead batteries and having some trouble with one of them where one of the cells has trouble charging up to 4.35 where the other 3 cells do not. Battery of course reports cell damaged because of 0.2V lower on one cell. Any tips from the people who play with the cell packs?

0r10nV commented 3 years ago

Before assembly all 6 cells should be properly matched by capacity, internal impedance and state of charge otherwise it will throw cell error under the load or while charging.

mixeysan commented 3 years ago

New keys for unseal DJI Mavic 2 Battery bq40z307 who did not know key1 - 0xxxxxxxxxx key2 - 0xxxxxxxxxx Many thanks to mefistotelis for his hard work and wonderful instruments!

mixeysan commented 3 years ago

bat&drone_dump_new_0770_fw_update_OK_cmd.7z.zip Traffic between the battery and drone Mavic 2 Pro from power ON to power OFF during battery firmware update.

mefistotelis commented 3 years ago

Nice; thanks for sharing!

stekiro commented 3 years ago

If your target is just a large capacity battery then there is one simple trick to make gas gauge correctly reporting State of Charge. It's to reduce Current Sense Resistor proportionally to increased capacity. And that's it! This way goes Chinese double-power copy battery producers. This way goes even DJI in some of genuine battery packs. In FB1 for Dji Mavic Pro for example. Sense resistor is half of nominal value and all Current and Capacity parameters measurements are done with 1:2 ratio. Then Relative State of Charge is calculated correctly. Other parameters doubled in msp430 when reporting to Drone over uart.

hi @0r10nV have you a photo of sense resistor in the mavic pro ? or a link for that ? thankyou

0r10nV commented 3 years ago

hi, it's here in white circle, two pcs in parallel 4mOhms each

Untitled3

stekiro commented 3 years ago

hi, it's here in white circle, two pcs in parallel 4mOhms each

Untitled3

Very thankyou!! so i need approx a 0,0027 for a 5200mah lihv... where can i found that ?

mefistotelis commented 3 years ago

Maybe just solder another one on top?

https://www.codecogs.com/eqnedit.php?latex=%5Cfrac%7B1%7D%7B0.0027%7D%3D%5Cfrac%7B1%7D%7B0.004%7D+%5Cfrac%7B1%7D%7Bx%7D

stekiro commented 3 years ago

Maybe just solder another one on top?

https://www.codecogs.com/eqnedit.php?latex=%5Cfrac%7B1%7D%7B0.0027%7D%3D%5Cfrac%7B1%7D%7B0.004%7D+%5Cfrac%7B1%7D%7Bx%7D

yes i have do that but ; now i have 3 res x 0,004 total is = 0,0013ohm... i think is too much

0r10nV commented 3 years ago

so i need approx a 0,0027 for a 5200mah lihv... where can i found that ?

my calculation shows different value, it's reverse proportion so larger capacity should use less resistance

3850mAh (factory) => 2 mOhms (4||4) 5200mAh (mod) => 2 * 3850/5200 => 0.00148 => 1.48 mOhms

It's roughly 1.5mOhms, exactly like in DJI P3 battery board, 2 pcs of 3mOhms in parallel, so if you have this pcb in spares you could take it out there.

But the best practice is to reprogram the chip to proper capacity then messing with shunt resistors.

Manpreetbhatiaji commented 3 years ago

IMG_20210522_193213_1 Hi, just a offshoot to the discussion. I had put a small lipo 800mah in parallel to the cell3 in Mavic air battery. The cell 3 was spoiled during a high drain discharge. Now I can fly this battery back. Lot of challenge thou. Seperately charging this lipo being 1

svarteld commented 3 years ago

Guys, want to say thank you for the guidance.

I've just flown the first two Inspire 1 TB47 batteries I've resoldered new cells into. Turns out DJI puts heatsinks between each cell, and also a spacer between every two for air circulation; I've redone the new ones the same way. Managed to not destroy the thermistor, so that one's still reporting temp. After a power cycle the BMS reports full 4500mAh from the new cells, and power graphs from flying looks perfectly normal, no deviations. Landing at 10% got me 16 min flying; so far, like a new TB47. I'll try TB48 cells next in some old TB47; got 8x of dead ones bought cheap.

Thanks again.

IMG_0304 IMG_0315 IMG_0310 Screenshot 2021-06-21 at 22 21 02 Screenshot 2021-06-21 at 22 21 19

ciasteekk commented 3 years ago

Hey,

any updates about unlocking spark battery?

mefistotelis commented 3 years ago

If I remember correctly, comm_sbs_bqctrl.py supports BQ40z307 in general, but it does not support clearing PFF2 flag. This hasn't changed. Also, all updates in the code are tracked - this is what GIT is for. This means you can check what changed recently yourself.

rokz12 commented 3 years ago

Hi just wondering where are you located ?Did you have much trouble desoldering/remove old cells

svarteld commented 3 years ago

Hi just wondering where are you located ?Did you have much trouble desoldering/remove old cells

@rokz12 Sweden. No problems desoldering, just watch the thermistor, it's thin and fragile. Use thin metal strips to open batteries; needs to be thin metal under all plastic hooks before removing top white from black. Reuse heatsinks and spacers. Afterwards all just snaps together, looking like new. Good luck!

rokz12 commented 3 years ago

Great thanks i have about 400 packs here myself.And want to rebuild them to sell so also looking for a good supplier of lihv cells ?

On Wed, 23 Jun 2021, 2:52 pm svarteld, @.***> wrote:

Hi just wondering where are you located ?Did you have much trouble desoldering/remove old cells

@rokz12 https://github.com/rokz12 Sweden. No problems desoldering, just watch the thermistor, it's thin and fragile. Use thin metal strips to open batteries; needs to be thin metal under all plastic hooks before removing top white from black. Reuse heatsinks and spacers. Afterwards all just snaps together, looking like new. Good luck!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/o-gs/dji-firmware-tools/issues/17#issuecomment-866855015, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXC56XP4LINARP37FROFVTTUHRKLANCNFSM4C7QHINQ .

svarteld commented 3 years ago

@rokz12 there's a company that makes refurbished TB47 and TB48; HeliEngadin. Any inspiration from them?

Regarding cells, I'd give HSABAT a try; Alibaba/Aliexpress. There's an option with 12 cells already soldered together with the top connection board to fit inside TB enclosures, so only a couple of wires to resolder for all those 400 units.

What brand will you be selling those under? Price idea?

OlliDXD commented 3 years ago

@rokz12 DJI cells are supplied by ATL, maybe you can get a bulk order from them.

rokz12 commented 3 years ago

Unfortunately they are licensed to sell only to DJI ......think I will carry on using the 18650 cells or get some Tesla 21700

On Mon, 5 Jul 2021, 11:58 am Oliver, @.***> wrote:

@rokz12 https://github.com/rokz12 DJI cells are supplied by ATL https://www.atlbattery.com/en/index.html, maybe you can get a bulk order from them.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/o-gs/dji-firmware-tools/issues/17#issuecomment-874018730, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXC56R42N5RUDCUWTZW2O3TWGF4PANCNFSM4C7QHINQ .

svarteld commented 3 years ago

@rokz12, if you'd like to sell some of your dead TB47/TB48 to me (like 5-10), I'm interested. Or perhaps I send one back to you to try, with new cells as a thank you? Cheers /P

rokz12 commented 3 years ago

Where are u located

On Tue, 6 Jul 2021, 9:40 am svarteld, @.***> wrote:

@rokz12 https://github.com/rokz12, if you'd like to sell some of your dead TB47/TB48 to me (like 5-10), I'm interested. Or perhaps I send one back to you to try, with new cells as a thank you? Cheers /P

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/o-gs/dji-firmware-tools/issues/17#issuecomment-874574855, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXC56TDKLR3KEXEPEUDEYLTWK6RTANCNFSM4C7QHINQ .

svarteld commented 3 years ago

@rokz12 Sweden (EU), Norrköping

Where are u located

rokz12 commented 3 years ago

Pity as unable to send batteries to Sweden....unless u can find someone that can

On Tue, 6 Jul 2021, 9:44 am svarteld, @.***> wrote:

@rokz12 https://github.com/rokz12 Sweden (EU), Norrköping

Where are u located

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/o-gs/dji-firmware-tools/issues/17#issuecomment-874577443, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXC56SYWJXSO3YPN7ALM5LTWK67VANCNFSM4C7QHINQ .

svarteld commented 3 years ago

If you remove cells it should be OK? Also light to ship. Easy after the first one's done, but still some work.

OlliDXD commented 3 years ago

@svarteld I've got a TB47 with 2 cells that won't wake up(most likely dried up) Linköping if you're up for it.

svarteld commented 3 years ago

@OlliDXD if it's cheap absolutely; 200 kr?

OlliDXD commented 3 years ago

@svarteld Do you have a preferred way of contact? I'd like to exchange a few words to double check a couple of things with ya.

rokz12 commented 3 years ago

Hi sorry for the late reply just busy. I can send but will be end next week..

On Tue, 6 Jul 2021, 10:47 am Oliver, @.***> wrote:

@svarteld https://github.com/svarteld Do you have a preferred way of contact? I'd like to exchange a few words to double check a couple of things with ya.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/o-gs/dji-firmware-tools/issues/17#issuecomment-874620178, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHXC56VYH4SZ64ES3JGGA2DTWLGLRANCNFSM4C7QHINQ .

svarteld commented 3 years ago

@OlliDXD mail is fine; svarteld at gmail dot com. @rokz12 no worries mate, totally fine; send a mail at the adress above if you'd like to discuss anything.

Thanks guys

OlliDXD commented 3 years ago

@svarteld sent you an email the other day

svarteld commented 3 years ago

@OlliDXD sorry, I've been in vacation mode here :-) Mail sent

nospam2000 commented 2 years ago

@pawelsky

Communication with the [P3] battery is done via serial at 115200 baud

I'm a bit confused. The labels on my P3 battery (PH3-4480 mAh) connector-board are "SDA" and "SCL" (see attached picture) and are connected to testpoints on the main battery board using the same labels, therefore I thought the external connector would be using the SMBus (or i2c) protocol. My battery main board matches the picture here in this thread and the wiki of this repo. My drone is a P3 SE.

According to the RC on the video you have a different P3 model than me, but I thought the batteries are the same for the whole P3 family, except that the one for the Pro can be charged faster.

Can you please shed some light into this topic? Do some P3 battery models use UART and others SMBus protocol to talk to the battery?

Phantom_3_battery_i2c_pins_board_small

pawelsky commented 2 years ago

Can you please shed some light into this topic? Do some P3 battery models use UART and others SMBus protocol to talk to the battery?

The fact that the pins are labelled as I2C on PCB does not automatically make them I2C. Their function can be configured in software. To my knowledge all the P3 batteries are the same, but I did not follow the P3 market for a long time, so can't tell if anything changed over the years.

All I know is that I communicated with the P3 battery using serial @ 115200. The easies way to check if that is still the case is to connect a serial adapter to the TX wire and listen to the communication.

hsiboy commented 2 years ago

Wow, this is one heck of a github "issue" thread 🤔

I think i've read every message here carefully, but did anyone find the unseal key for TB47/TB48?

I've re-celled several packs, but i need to recalibrate and of course, unseal to do so.

image image

Cheers,

hsiboy

wang909 commented 1 year ago

如果有人想要,第一步是查看电池板并确定所使用的微控制器。

然后可以使用合适的反汇编程序来查看代码。

I have a DJI T30 battery with only STM32L071CZT6 chip on it How to unlock the battery

wang909 commented 1 year ago

你能明白这个话题吗?有些P3电池型号是否使用UART和其他SMBus协议与电池通信?

事实上,引脚在PCB上标记为I2C并不会自动使它们成为I2C。它们的功能可以在软件中配置。据我所知,所有的P3电池都是一样的,但我并没有P3鼎有鼎市场,所以无法判定这些年来是没有任何变化。

我所知道的是我使用串行@115200与P3池通信。检查是否仍然如此的简单方法是将串行适配器连接到TX线并收听。

I have a DJI T30 battery with only STM32L071CZT6 chip on it How to unlock the battery

Shayansts commented 10 months ago

Wow, this is one heck of a github "issue" thread 🤔

I think i've read every message here carefully, but did anyone find the unseal key for TB47/TB48?

I've re-celled several packs, but i need to recalibrate and of course, unseal to do so.

image image

Cheers,

hsiboy

Hello, where did you connect the ev2400 to the battery board?

pawelsky commented 10 months ago

Hello, where did you connect the ev2400 to the battery board?

Did you try testpoints marked SMBC, SMBD and GND? :)