A two-degree-of-freedom PI controller based on events