Principle of lithium battery controlled energy storage system