×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Raspberry Pi based Observatory Controller

  • Posts: 33
  • Thank you received: 5
I’ve hinted a couple of places that I’m working on a Raspberry Pi based ROR Observatory controller. While not where I would like it, it’s taking shape and time to solicit some input. I've also posed on Cloudy Nights under observatories an will try to watch both and have shortened this post a bit.

So the question as you read this is: what else should the infrastructure controller do?

The controller is intended to run 24/7 keeping the observatory safe. That means heat if cold or wet, close the roof if raining or the users drop their link for a prescribed length of time. Before closing the roof, signal the telescope to move to its park position(s) and so on. EKOS would make a request to open, but the server would check it operational criteria before opening.

Current sensors and I/O include-
- Switches ( 8 ) from the Piface2 board, more can be added
- Outputs ( 8 ) Piface 2 plus four channels of AC SS-relays and four additional mechanical relays I plan to drive from the Piface D2.
- 1w thermal sensors DS18S20 or similar. I have 2 but many more can be added
- INA226 voltage/current sense boards, I have 2 coming
- MLX90614 for a cloud sensor (wide version I think, will almost certainly add a second, probably on the scope.
- AM2301 temp and humidity with dew point available
- I am using a Pi-EzConnect board as a breakout for the I2c and 1wire. Expect to add a max332 level shifter for RS232

Additions?
- should add a light sensor, which should be easy and also redundant (clock time and timeouts also work).
- Next addition is probably a couple of Pololu Simple Motor Controllers. I can use them for my roof open/close
and mount up/down and they look like just the thing for a dome (thanks stmguy!). That would free up 4
relays, which I could use as it turns out.
- GPS/Stratum-1 clock sever would also be a nice addition but not explicitly part of this software.
- plan to include email and/or text alerts on alarms, but haven’t looked into that yet.
- have a web cam, might add it’s input to the web interface.
- would like to interface to a home automation technology to use those outlets. All I can find so far are
hacks or discontinued interface, but that is being tracked.

Pretty much any on/off function can be controlled-- dew heaters, roof motors, lights and so on. Almost anything can be monitored-- temp, humidity, current, voltage and anything with a switch including motion or intrusion alarms. There is no intent to control the telescope or cameras but you could with INDI. I like the Pi, but for scope and camera control with plate solving I’ll probably use something a little more powerful, but that’s me.

Last, this will go into public domain. Not sure if it will end up on git or one of the yahoo groups or here,
but will be posted “someplace” :-).

Any big “wants” out there? Anything come to mind?

More details a bit later….
The following user(s) said Thank You: Jasem Mutlaq
Last edit: 7 years 1 month ago by Greg Jones.
7 years 1 month ago #14359

Please Log in or Create an account to join the conversation.

Very interesting project! Currently in my own observatory, I have Davis Pro weather station, but for things like rain detection, it's quite unreliable. I usually run with the WatchDog driver so if connection is lost, it performs a shutdown procedure. I guess your project is a mix of watchdog/weather INDI drivers. It would be very interesting if you can combine all of these sensors in one DIY package that someone can install in their own observatory and provide hooks to the mount and dome drivers.

I also have the AC controlled within my observatory (it's off now in winter), so it would be interesting to leave relay spots on the board as well. Good luck and I'll be definitely watching this!
7 years 1 month ago #14375

Please Log in or Create an account to join the conversation.

  • Posts: 33
  • Thank you received: 5
Jasem, thank you. Hopefully it will be of use over time.

Rain detection is a tough one. I have a switch input now, but the way it's set up, it could be anything including a file read. The biggest issue with rain it that you want to close up BEFORE it rains, not after it's rained for 10 minutes. Drop detector is cheap and easy, of questionable reliability, so you probably want to trip on the cloud detector if you can and panic if you see drops. The optical rain sensors are getting some play and heating the sensor plate to dry it out a little faster is also used by some.

The server is intended to run all the time, so would monitor connections and shut down if all connections are dropped for say 15 minutes. Will also have the watchdog set so a crashed or hung program will restart the system. I live in western Oregon, winters like this one can be real wet. I want the option for some level of heat or humidity control to be available inside the observatory. That and remote control of the roof are the primary impetus for the project. As long as I am at it, though I would add the cool stuff for robotic/remote operation.

I have about $115US into the controller right now, RP3, Piface-D2, Pi-EzConnect, 4 channel mechanical relay board, 4 channel SS relay board, 2 current/voltage sense boards and the sensors. These are all off the shelf, I have built no hardware, no boards. The intent is off the shelf, cheap available hardware. The Ez-connect is just a way to connect wires so could be replaces by a connector and piece of perf board. Once done, i would also be easy to roll a dedicated board (not planned)- optio Isolated 16x 16 I/O, 1-wire driver, RS232 and RS485 channels w/ drivers, I2C buffered output would probably do it. No reason to put the relays on this board or any of the sensors unless you want Temp for the Pi.

Planned functions- Roof open/closed, Mount up/down, Park (request and sense), Observatory "heat", dew heaters, Mount power, Observatory Computer power, lights. Alarms to my cell via text/email. Blue tooth and WIFI are available of course.
Monitors for- rain, clouds, sense temp/humidity and calculate dew point, drive current (and maybe temp), Roof motor current (mine is DC with linear actuators tilt-off), Motor temp an option.

Requests for- Stratum 1 (GPS) clock (will probably add but as a stand alone process not part of the code I am writing, some concern about interrupts). Vibration/earthquake monitoring (easy to add, probably at a later date). Satellite link back door (probably add as an additional interface process like INDI, very do-able). Davis Pro input (again, easy to add but I don't have one, so later), RS485 for industrial sensors.

I will have at least one more PC class computer in the observatory. That one will be connected to the mount/telescope and camera. I hope to have it's data storage setup as a RAID 1 for data capture, but will have to see how that goes. The Pi will control the power to that computer. Overall control and scheduling will probably come from inside the house, at least that's the plan. I don't actually do video bit might as well be. Lots of data if this gets going, ~1TB/week... More than I think a Pi can handle and lot's of reason for a bigger machine that can do some of the data reduction.

Sorry, a little more musing than I had planned... :-)

Greg
7 years 1 month ago #14379

Please Log in or Create an account to join the conversation.

  • Posts: 33
  • Thank you received: 5
Quick question on log files. There seem to be two reasonable options: 1) .csv files or 2) an actual database (mySQL (?)).

Seems like there are about 3 things to log, all would be settable but for data allocation and time stamped -
a) Overall Status - hourly to daily
b) Environmental Data - temp and sky data might be every 10 minutes during operation, and maybe 30minutes otherwise.
c) Events- open roof, close roof, heat on, Dew system on/off and so forth.

Option 1 would probably be a directory with a .csv file for each if the above. I suspect this option would be easier for the casual observer with Excel or Calc.
Option 2 would probably be a mysql database with a table for each. Power users might prefer this,especially if the data
can be exported to the cloud or to a facilities server.

Implementation seems about the same for both but a bit more work to get useful data out of option 2.

Thoughts?
7 years 1 month ago #14643

Please Log in or Create an account to join the conversation.

How about SQLite3? Pretty simple and no server required. Performance seems to be getting better with each release.
7 years 1 month ago #14659

Please Log in or Create an account to join the conversation.

  • Posts: 983
  • Thank you received: 375
Why not to use weewx for logging weather and other data? It's very handy and easy to develop custom data source. I have built my weather station based on arduino and raspberry with it.
7 years 1 month ago #14662

Please Log in or Create an account to join the conversation.

  • Posts: 33
  • Thank you received: 5
Looks like weewx works on top of both mysql or SQLite3.

As it turns out, writing the data out in any of these formats is really simple. The analysis part is a little more difficult, but just a little. I've been conversing with one of the engineers that does these things for a living at some of the professional observatories. He's suggesting I log events as that will in the long run minimize the size of the data log. That also means I can compress the log interaction to a single common procedure call within my code making a later change really easy.

For the first few turns, I think I'm going to use the .csv files. .csv files can be pulled into a database, but are also easy to read in calc. Should save a lot of time during debug.

I will look more at weewx and SQLite3 going forward. Less overhead than mysql would be good and segmenting the weather data out would have benefits too.
7 years 1 month ago #14666

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 5
I'm a recent convert to the INDI software, and have been reading through loads of material in an attempt to solve a number of my Observatory dome setup tasks. I've been following your material with some interest since I too have settled on a very similar design approach to the one you seem to be following.
Like you, I did a long list of wants/wishes for I/O stuff. We pretty well have matching lists, albeit there are generic type devices differences (air con, dehumidier, heater lights/red lights etc), which any relay port can drive, and I will have different needs to yours.

But I do have one 'sensor' that is novel and doesn't fit anything I've come across so far and ay be worthy for you to consider. In my design I have approached the dome rotation controller as an asychonous process from the dome motor mechanism (ie I don't need to count steps and calibrate incremental movement from a fixed angle e.g. micro switch trigger for home location type thing). Instead, I intend to make the dome rotation motors match the telescope RA with reference to feedback from a dome angle detector (magnetometer). I intend to instruct the dome motor controller to track RA, or rotation to home position etc.

I have not solved how to make this data available within the INDI framework as yet, (although the sensor is running happily providing reliable angles in real-time to an IP addressable process). Obviously my approach is quite specific to me and my setup, but I would be interested to know if you have encountered similar issues in your design, and how you have solved them.
6 years 10 months ago #16947

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 5
Your references to home automation - any update on designs decisions made? I've considered Home assistant and MQTT as the way to go - it solves a number of technical interfacing problems, but you might also take a look at "mydevices.com" its developing very fast in the sensor/Rpi automation IoT space.
6 years 10 months ago #16948

Please Log in or Create an account to join the conversation.

  • Posts: 33
  • Thank you received: 5
Rob,

I made a lot of progress then work heated up. I don't need the magnetometer for my tilt off roof but am planning on adding it for Dome use. The plan is to use either a Bluetooth or WiFi dongle (I have a SparkFun ESP8266 Thing and 3 axis compass for the task). I think I'll need to use a compass and gyro to get the needed precision/repeatability but the slow movement and averaging may be enough. The module above has a LiPo battery charger built in so it should be possible to solar charge it meaning no wired connections.

I also have a DC motor controller that's intended for dome control. I have a small (low current) model but the interface is the same as their larger versions which should be enough for most domes. Of course simple AC/DC motor control (ie. via relays with reversible motors) can be handled that way with the accompanying clicky-clack and greater maintenance

Greg.
6 years 10 months ago #16949

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 5
Interesting stuff.

I've gone for Pi Zero W, with an EnviroPhat from Pimoroni.com.(Temp/Baro/Mag/Accel/lightsensor/anaolguex4). Like you, I thought might need the full 9 degrees of motion for accuracy, but I have found the compass alone is sufficient/accurate and gives good repeatable readings. I guess you might need to be careful where you place it (ie nowhere near motors!). I've loaded the Zero with SAMBA and MQTT and getting very good low power unit. I'm playing with the pi-supply circuit so that you can software-instruct the device to power-down safely. My thoughts are my shutdown sequence will include a dome rotation to a fixed home point where slip-connectors will recharge the batteries in the dome roof. An auto power up circuit will trigger the Pi to power up when I move the dome off the recharge point - not designed that yet. Thus I have software control on power-up and power down for the dome as well.
I will be extending the unit to control the shutter open/close, and of course being a Pi I also have a Webcam option too! (all under $60).

Keep us all posted - I very much in learning mode, but tinkering away when I have chance. Do you have some software on the go?
6 years 10 months ago #16955

Please Log in or Create an account to join the conversation.

Time to create page: 1.098 seconds