danielnilsson9 / bbs-fw

Open source firmware for multiple electric bike motor controllers.
GNU General Public License v3.0
191 stars 39 forks source link

modifications to lvc rampdown computations #209

Closed EigenMania closed 3 months ago

EigenMania commented 11 months ago

I'm proposing a very slight modification for how the LVC rampdown computations are performed. I changed LVC_RAMP_DOWN_OFFSET_PERCENT to reflect the battery percentage when LVC rampdown starts, and the LVC rampdown ends when 0% battery is reached (the padded value), thus protecting the battery a bit more from discharge at configured LVC (and lining up with the displayed battery percentage).

Also moved the defines from battery.c into fwconfig.h and added some more detailed comments / examples for the battery math.

timothymiller commented 5 months ago

Looks good to me. Ship it!

danielnilsson9 commented 3 months ago

Seems like a reasonable change, thanks!