  We study the optimal control of battery energy storage under a general
"pay-for-performance" setup such as providing frequency regulation and
renewable integration. In these settings, batteries need to carefully balance
the trade-off between following the instruction signals and their degradation
costs in real-time. Existing battery control strategies either do not consider
the uncertainty of future signals, or cannot accurately account for battery
cycle aging mechanism during operation. In this work, we take a different
approach to the optimal battery control problem. Instead of attacking the
complexity of battery degradation function or the lack of future information
one at a time, we address these two challenges together in a joint fashion. In
particular, we present an electrochemically accurate and trackable battery
degradation model called the rainflow cycle-based model. We prove the
degradation cost is convex. Then we propose an online control policy with a
simple threshold structure and show it achieve near-optimal performance with
respect to an offline controller that has complete future information. We
explicitly characterize the optimality gap and show it is independent to the
duration of operation. Simulation results with both synthetic and real
regulation traces are conducted to illustrate the theoretical results.
