I'm looking to mount an air cylinder to our lathe for opening and closing the door automatically.

Attaching the air cylinder is straight forward; in fact some of the provisions are already in place.

Has anyone made a DIY auto (servo) door that uses the M80 and M81 open and close commands?

Otherwise, I'm planning on using one (or two) of the spare M codes and any advice would be welcome.