The Hamburg Robotic Telescope (HRT) is a fully automatic 1.2m telescope designed for high resolution spectroscopy
of active stars. It uses the Heidelberg Extended Range Optical Spectrograph (HEROS) which is fed by
a 50μm fiber connected to the Nasmyth focus of the telescope through an adapter. Here we present the software
that controls the whole system of the HRT. This software works both in fully automatic and interactive mode.
It organizes the interaction between the Central Control System (CCS: the core of the system) and the subsystems:
building, telescope, spectrograph, adapter, environmental sensors (weather station and sky monitor) and
scheduler. The CCS performs its operation by sending commands (ASCII messages through TCP/IP sockets)
to the different subsystems. The robotic operation is divided into discrete procedures, such as "Initialization",
"Observation" or "Calibration". Each procedure consists of a set of commands which will be carried out (sequentially
or even in parallel) if a set of conditions is met: e.g. only when one command is successfully accomplished,
the next will be sent. Furthermore, the Error Handler takes the necessary actions when a problem inhibits
the normal progress of the observation (e.g. bad weather, non-detection of the target or technical problems.
The scheduler selects the target from a primary list in a manner which combines the scientific priority with
observational feasibility and the history of observations. Finally, we present the Automatic Reduction Pipeline
developed on the basis of REDUCE, an IDL reduction package, to obtain the final spectrum from the raw data.