A converter converts mechanical energy of a piston to and from electrical energy during each piston cycle.