Energy harvesting and energy efficient control for variable impedance actuators