# LiIon battery discharging

I have a question regarding LiIon battery discharging. Lets say I have a battery which is connected to a dc bus via a battery charger which has a bypass contactor in parallel.

The charger is capable to supply some maximal discharging current Imax01. In case I need greater discharging current than $$\I_{max_{01}}\$$ I can shortcircuit the battery charger via the bypass contactor. In that case I can discharge the battery with discharging current $$\I_{max_{02}} > I_{max_{01}}\$$.

The desired discharging current is calculated by the a dc bus voltage PI controller based on the dc bus reference voltage and dc bus actual voltage. The discharging current is controlled by a current PI controller in the charger based on the reference value from dc bus voltage controller and actual value measured.

The problem is that I don't know how to determine the time instant when the bypass contactor shall be closed which will cause the charger to be "removed" from the discharging process (question is whether this "by the load controlled" discharging is good idea at all and what influence will this action have onto the dc bus voltage controller). My first idea was to determine the bypass contactor closing based on magnitude of control error value i.e. $$\U_{dc\_bus\_ref} - U_{dc\_bus\_act}\$$. In case it is greater than some threshold that the bypass contactor is closed and otherwise it is opened. Does anybody have any idea how to realize quick discharging of a battery in my conditions i.e. battery connected to the dc bus via battery charger capable of carring current less than nominal battery discharging current? Thanks for any ideas.