This paper presents a problem framework and its solution method to determine the cooperative operation plan of controllable generators (CGs) and batteries in microgrids. In the problem formulation, the authors emphasize the operational penalty of microgrids' operation, and then provide additional alternatives for microgrid operators. Specifically, the supply-demand balancing constraint is relaxed and integrated into the objective function as a penalty term. Here, the penalty means the amount of electricity trading with the main power grid. The objective function is designed as to minimize the total operation costs which consist of the sum of the operation costs of microgrid and the extra cost for compensating the imbalance. Moreover, the optimal operation plan is determined by an enumeration-based binary particle swarm optimization algorithm (enumeration-based BPSO). In the results of simulations, it is confirmed that the batteries perform the load shifting and reduce reserve shortfalls together with incurred fuel costs for minimizing the total operation costs.