The Montsec Astronomical Observatory (OAdM) is a small-class observatory working in fully unattended control, due to the isolation of the site. Robotic operation is, then, mandatory for its routine use. We present a description of the general control software and several software packages developed. The general control software protects the system specially at the identified single points of failure and makes a distributed control of any subsystem. Copyright © 2010 Josep Colomé et al.