Control of a Variable Speed Generator to Optimise Output from a Heaving Wave Energy Device