commaai / openpilot

openpilot is an operating system for robotics. Currently, it upgrades the driver assistance system on 275+ supported cars.
https://comma.ai/openpilot
MIT License
49.93k stars 9.1k forks source link

Implement a Low Voltage Disconnect in next generation hardware (stranded/dead battery fix) #2696

Closed zorrobyte closed 3 years ago

zorrobyte commented 3 years ago

What are we trying to solve? https://github.com/commaai/openpilot/issues/2677

An edge case exists where OP software can boot/crash/freeze to a bad state where the phone's backlight is on while the screen is black (or any other condition where OP doesn't cleanly exit/shutdown). I've personally had at least two events where I was stranded due to this, one while camping (and it only took 6-8 hours for my Prius's tiny battery to drain).

Lead-acid batteries will reduce their usable lifespan if drained past 50% depth of discharge by up to half, and especially considering starting batteries are even more vulnerable (non"deep-cycle"). At 10~ total discharges due to issues with OP over the last year, my Prius's battery is now in need of (costly) replacement.

Consider at even 173mA, a brand new Prius/Prime 12v battery will be at 50% charge after just 5.5 days, something the battery is not designed for (more calculations in above issue) image image

Ideas to resolve Implement a LVD in comma power to switch off power at 11.7 volts; for example, or even further upstream in Uno. Next generation hardware should have some sort of native implementation, especially for consumer release (software will always eventually crash).

Immediate fixes I've installed one of these https://www.amazon.com/PriorityStart-12-Volt-Pro-SP-Automatic-Battery-Protector/dp/B0030A10V0/ref=sr_1_3?dchild=1&keywords=Priority+Start+12-Volt&qid=1606925871&sr=8-3 - same concept (no, I'm not affiliated with them in any way)

AkshatGiri commented 3 years ago

Same issue here. My Prius battery died twice because of this. The first time I didn't think comma could be the cause but the second time it was clear.

Flekoun commented 3 years ago

After 8.0 my Toyota Corolla 2.0 TS (2020) experienced complete battery drain 3 times in a row! Fix this pls. For now I am unplugging the comma 2 until this is fixed. Add an option to completely auto turn off the comma 2 after the car is powered off.

VirtuallyChris commented 3 years ago

It should have been fixed via https://github.com/commaai/panda/commit/9f5f437c90e604623ffe2813704d0943d6097a87 and a hotfix to 0.8. What zorrobyte is talking about is if the device doesn't build, and fails to run the logic we added to prevent battery drain.

carasen12 commented 3 years ago

Se puede usar en coche hibrido?

robbederks commented 3 years ago

Thanks for the suggestion. The problem isn't very easy to solve with voltage measurements (too much noise, voltage drop due to current, not a very good indication of state-of-charge, ...), and that's why we now have the power integration built into openpilot. This basically is coulomb-counting both the discharge due to the device's power usage, and also estimating the SOC of the car battery depending on how long it has been on-road for example. Designing this kind of system is not trivial in hardware, but we'll keep it in mind for potential future hardware. We agree that the experience of a dead car battery is terrible, and must be avoided wherever possible!

zorrobyte commented 2 years ago

Bumping as I mentioned this in EPHOT for C3, maybe it can make it in for C3 Slim, newer HW cc @geohot @robbederks -- Consider re-opening this issue. Certainly will need done before a "retail" release.

Discord links to users complaining about dead batteries (including Comma 3): https://discordapp.com/channels/469524606043160576/871838269405556736/936034635249512498 https://discordapp.com/channels/469524606043160576/774341890089680946/932113360344989697 https://discordapp.com/channels/469524606043160576/524611978208215070/906647291572650014 https://discordapp.com/channels/469524606043160576/469532500335656972/857720814894710795 https://discordapp.com/channels/469524606043160576/525718620517564446/836980557216612382 https://discordapp.com/channels/469524606043160576/538741329799413760/819251996354805801 https://discordapp.com/channels/469524606043160576/524593232290775051/781001330155978752 https://discordapp.com/channels/469524606043160576/525718620517564446/774108398890778634

Some sort of hardware LVD would be helpful built into the Comma Power/C3. Maybe something like this? https://www.mouser.com/datasheet/2/268/MIC2779_Voltage_Monitor_with_Adjustable_Hysteresis-1891106.pdf Would also protect from high voltage.

All you guys should really need to do is have a cutoff at a specific voltage like this device does: https://www.amazon.com/PriorityStart-12-Volt-Pro-SP-Automatic-Battery-Protector/dp/B0030A10V0/ref=sr_1_3?crid=B0DOASMC5RM3&keywords=priority+start&qid=1643492099&sprefix=prioritystart%2Caps%2C76&sr=8-3

I've installed one in every car I have and it saved my Prius from a few more dead batteries due to comma hardware

This is one I use in my RV to protect my 12v bank: https://www.bluesea.com/products/7635/m-LVD_Low_Voltage_Disconnect