Piezoelectric material‐based semi‐active vibration control systems may effectively suppress vibration amplitude without any external power supply, or even harvest electrical energy. This bidirectional electrical energy control phenomenon is theoretically introduced and validated in this paper. A flyback transformer‐based switching piezoelectric shunt circuit that can extract energy from or inject energy into piezoelectric elements is proposed. The analytical expressions of the controlled energy and the corresponding vibration attenuation are therefore derived for a classical electromechanical cantilever beam. Theoretical predictions validated by the experimental results show that the structure vibration attenuation can be tuned from −5 to −25 dB under the given electrical quality factor of the circuit and figure of merit of the electromechanical structure, and the consumed power is in the range of −13 to 25 mW, which is a good theoretical basis for the development of self‐sensing, self‐adapting, and self‐powered piezoelectric vibration control systems.