There are thousands of patents for perpetual motion machines. An invention must be novel, useful and non-obvious to be patentable, but it doesn't actually have to work.
I think the current policy is they are only patentable if there is a working unit that runs for at least a year when left alone in the patent office.