Take total energy consumption of flexible manufacturing systems as an objective. Consider two ways of dividing resources states. Two energy consumption functions are proposed. Deadlock situation is avoided by adopting an optimal deadlock avoidance policy. Experiments on a typical FMS and an industrial stamping system are provided.