Wave-to-grid (W2G) control of a wave energy converter