This is an old revision of the document!
Table of Contents
Software
Overview
Overall software design is to control all components from a main server computer, song1m, located in the main computer room, running Linux. This communicates with the telescope/camera computer, pwi1m, and the dome computer, dome1m, via network communication; this is extendable to additional devices on additional computers. The preferred communication protocol is ASCOM/Alpaca, but other network communication can be used for additional functionality as needed.
Devices can also be controlled locally from the computer to which they are attached, as this is useful for lower level functionality, debugging, etc.
A schematic of the software architecture is shown below (click to enlarge).
Control software
Software is implemented so that all devices can be controlled from a single command-line program running on a separate computer, using software in the APOsong repository (github.com/holtzmanjon/APOsong). Given that all of the devices are on the internal APO network, the main control computer, song1m, is located on this network, and remote operation can be done using VNC with an openVPN or tunneling connection. On song1m, the software environment is set up for the song user.
The control software is run from a Python environment; APOsong provides commands to control the telescope, dome, camera etc., but you can also use all regular Python functionality, providing for a powerful environment. Within the APOsong software, interactive image display is enabled using the pyvista display tool and built-in, e.g. for the expose() command, but of course any other Python packages can be used interactively.
To access the software:
from aposong import *
You can get a quick listing of commands using
commands()
and you can use help(command) or command? to see the docstrings.
Documentation is also available at http://aposong.readthedocs.io
Robotic software
pwi1m
pwi1m runs Windows. For normal operation, several things must be running:
- the PWI4 software to control the telescope
- ASCOM remote to make the telescope, focuser, mirror covers and camera / filter wheel accessible
- the remote.server() server to talk with LTS150 stage (iodine cell stage), Zaber stage (camera focus stage), and TC300 temperature controller (for iodine cell)
- for the eShel spectrograph, python must be running the eshel.remote() loop, which accepts commands over a socket to send to the eShel calibration unit, controlling mirror and lamps via a USB/serial connection.
Planewave software
On pwi1m, the telescope is controlled through the PWI4 software. This also has the capability to control an ASCOM camera, necessary when using PWI4 to construct a pointing model.
On starting PWI4, devices are controlled from the left panel, which has five tabs: Mount/Focus/Rotate/M3/Temp. You connect to the telescope using the Connect button on the Mount tab, and you can enable/disable the azimuth and altitude motors. On the Focus tab, you connect to the focuser and enable/disable it, and on the Rotate tab, you connect and enable/disable the rotator. On the Temp tab, you connect the OTA, which allows you to get temperature monitoring, control fans, etc. The M3 tab is used to position the tertiary to the Nasmyth ports: Port 1 is the port with the rotator and focuser.
You can slew the telescope using the SkyViewer tab: click on the desired location, then confirm with Goto button. You can also just enter coordinates directly on the Goto tab. Tracking should be started after the slew. You can monitor the tracking performance with the Tracking tab. Temperatures can be viewed on the Temperature tab. Finally, a camera can be controlled through the Camera tab; you need to select the camera (ASCOM or MaximDL), and then connect to it.
The PWI also has ASCOM drivers for Telescope and Focuser, which the control software uses. The PWI also has its own web interface (see https://planewave.com/files/software/PWI4/python/), which we use to get some information that is not available through the ASCOM driver.
Focus
Pointing model
ASCOM remote
ASCOM remote must be installed and configured to see all of the ASCOM devices. This is achieved through the Setup button. Simply choose the type of device and select the correct driver.
Remote socket devices
Three devices are controlled via a simple socket server interface: the Thorlabs 150 stage (for iodine cell), the Zaber stage (for camera focus), and the Thorlabs TC300 temperature controller (for iodine cell).
The remote server is a simple interface, started using remote.server(). It accepts commands over a port and then sends appropriate device level commands to the hardware devices, using their APIs.
- Zaber stage https://software.zaber.com/motion-library/api/py
Dome software
Dome control is implemented through software running on a Raspberry Pi, dome1m.
Low-level functions are implemented in the APOAshDome.py module. An ASCOM Alpaca interface was implemented using the templates from the AlpycaDevice package. Software is archived at https://github.com/holtzmanjon/APOAshDome.
APOAshDome controls dome shutter and rotation through relays, reads dome position through an encoder, and also reads dome home switch. For the encoder, the pulses are read using the pigpiod daemon, so that must be installed and started every time the computer is rebooted:
sudo pigpiod -s 10
This has been implemented in /etc/rc.local on dome1m.
The dome software can be run locally from a python interface: from APOAshdome/device, start python and import APOAshdome. A Dome object can be instantiated through which properties and methods can be accessed:
import APOAshDome D = APOAshDome.Dome() ...
For documentation of the methods, see http://APOAshDome.readthedocs.io.
To start the Alpaca device after a reboot:
cd APOAshdome/device python app.py
Windows installations
- Install Windows 11 from NMSU USB. Account SONG
- Install TigerVNC 64-1.13.1 and TigerVNC-winvnc-1.13.1
- Install ASCOM 6.6SP2 (installs .NET 3.5)
- Install ASCOM Remote 6.7.1
- Install Anaconda3
- OpenVPN?
- Cisco AnyConnect?
- git for Windows
Modify timezone, location, display setting (for remote VNC), firewall as needed (for ASCOM Remote and TigerVNC), and power settings (don't let computer go to sleep).
For the spectrograph spec1m computer: QHY AllInOne StableVer.20220817 pywinusb to control USB relay visual studio C++ for alpyca install to run watchdog pip install yoctopuce for thermocouple
For the telescope pwi1m computer:
Camera drivers: Atik drivers QSI drivers (if needed)
Telescope software: Planewave PWI4 PWTools ? eShel software: pip install pyserial Keyspan 19H USB-to-serial TC300: pip install pyserial Thorlabs TC300B software (for desktop control) Thorlabs LTS stage: pip install pythonnet Thorlabs Kinesis software (for desktop control) Zaber stage: pip install zaber_motion Zaber launcher software (for desktop control)