Battery pack charging and discharging technology