A decision that needs to be made when building a roll-off roof observatory like mine is: Do I make it possible for the roof to hit the scope? At first blush, this is a dumb question: Of course not!
But there are some potential issues with making it impossible for the roof to hit the telescope. They are:
Suppose the roof is high enough that there’s no possibility that the roof can hit the scope in any configuration. In that case, a significant amount of the horizon will be unavailable to the telescope because the observatory walls will be taller than the minimum altitude the scope can point at. This means anything lower is not observable.
Which scope are we measuring? One of the nice things about an observatory is you can swap out telescopes when desired, and there’s not a lot of work to do to reconfigure things. But if you make the observatory walls high enough that the roof cannot hit any possible telescope, shorter telescopes will be unnecessarily obstructed.
As you can see in the above picture, I decided to require that the telescope be parked so the roof could close. This is pretty easy to do in INDI, as roof lock parameters exist in both the telescope and observatory drivers. On my telescope computer that controls all aspects of the mount, focus, guiding and imaging equipment, the INDI server has Mount_locks set in the Mount Policy attribute.
On the EQMod Mount driver for my Skywatcher NEQ6 mount, the Dome Policy is set to Dome Locks, so when the dome is parked, the telescope will not allow itself to be unparked (and moved around in the closed observatory.) The telescope computer remotely accesses the observatory driver as a remote INDI driver “Rolloff into”@10.0.0.100, so the driver acts like it’s local to the telescope.
Is this trustworthy? In theory, yes. In practice, no. Not trustworthy enough, in reality, to trust the safety of my equipment to the correct operation of the telescope parking function particularly. There have been occasions when the telescope has not parked properly, generally due to cable snags or striking some obstruction that causes the mount axis to slip. Once that happens, the mount is at some unknown position relative to the park position that has been set and will most likely be in a position where the roof is obstructed. In this situation, the appropriate course of action is to alert the operator to fix the position so the roof can successfully close. So, we need some way to determine whether the mount is properly parked.
My method is to take advantage of a sensor named a Hall Effect Sensor, which detects magnetic fields. If you position a magnet on the two axis of the telescope such that the sensor detects the magnet only when the telescope is parked in the correct position, this means we can detect a failure to properly park, and do something about it.
The circuit for this setup is pretty simple to create. Connect the Pin 1 on the Sensors (we’re using a module with a resister and LED available 4 for $30CDN on Amazon) to GND, Pin 2 to +5V, and Pin 3 to an analog input on an Arduino Nano. Here we have A5 and A6 being used.
The C code for the Arduino sketch is fairly simple also:
int raPin = A5; // Analog input pin for RA
int decPin = A6; // Analog input pin for DEC
void setup () {
Serial.begin (9600); // Set serial speed to 9600 bps
}
void loop () {
if (analogRead (raPin) <100) // read RA pin - ON if <100
Serial.print("{1");
else
Serial.print("{0");
if (analogRead (decPin) <100)
Serial.println("1}");
else
Serial.println("0}");
delay(1000);
}
The code will return {00} for both sensors open, }11} for both closed, and {01} and {10} for one or the other closed but the other one open. Anything but {11} would denote an unparked state so we would need to take appropriate action. You can see the results in the serial monitor in the Arduino IDE.
You can read this result using Python code like the following:
#!/usr/bin/env python3
import serial # pySerial
import time
try:
ser = serial.Serial("/dev/ttyUSB0",9600,timeout=1)
ser.flush() # Flush out the serial buffer
time.sleep(1) # Wait 1 sec for the buffer to refill
packet=ser.readline() # Read the result
except:
print("Serial error")
exit()
if (packet == b"{11}\r\n"): # Packet is a byte string with CRLF
print("Mount parked")
else:
print("Mount park fault!")
To run this script do the following (assuming you have Python3 installed):
python3 -m venv .venv
source .venv/bin/activate # in Linux
.venv\Scripts\Activate.bat # in Windows
pip3 install pySerial
python3 getParkstatus.py
In practice, I will connect the sensors to the Arduino Uno which operates my observatory roof, and modify the rolloff.ino sketch that runs on that Arduino to return a park fault to the observatory controller when the sensors are not set, prohibiting the driver from toggling the relay that parks the roof using an Aleko gate opener. The next step (in a subsequent article) is to do something about it!