Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

"Astrobox" - controls my obsy!


perfrej

Recommended Posts

I am building two remote observatories at the same time, one of them with multiple piers and a few fellow astrobuffs as co-conspiritors. A device to control all essential things was required. So I embarked on a journey to create the perfect gadget for that - and at as low a cost as possible ;)


 


One important thing with astro stuff, regardless of operating system, is USB. It is a very tricky thing to get stable, and the fact that the connectors are Rubbish also adds to the bonfire. I solved this with a hardware device that has an on-board 4-port USB hub with three of the ports switchable, both 5V and data leads. With that I can "physically unplug/replug" any USB device without doing anything to the computer. I have incorporated device drivers for ASCOM, but the protocol to talk to the thing is so simple that it would be a close to no-brainer to write scripts or any kind of driver for it.


 


General specs:


 


5 switchable 12V supply outputs


3 switchable 12V supply outputs that are switched together with...


3 switchable USB-ports


 


2 PWM 12V outputs for roof motors


4 digital inputs for roof sensors (opto isolated)


4 general inputs (opto isolated)


1 analog input for voltage check on batteries


4 general digital outputs (opto isolated)


1 sky quality sensor input (sensor is $5, same as in the commercial SQMs)


1 stepper motor driver for focuser


ATMEGA 328P processor with all "firmware" in Arduino code


 


As you can see, it is an entire observatory bar the astro imaging stuff. The focus driver, by the way, is a hardware stepper driver that can do unipolar and bipolar, and that micro-steps up to x8 if you want to run the motor without gear-box. There is software controlled hold/no hold also - good if you run naked steppers and need them to hold position under load.


 


The coolest feature is the switchable USB ports. They use analog switches specific for USB switching use. It really is 100 percent equivalent to a physical unplug/re-plug.


 


Great DYI project, indeed! Prototype (1 of 6) is running on my desk and will be integrated into the balcony setup this weekend. Since it has an Arduino boot-loader in the processor, you can write your own firmware with free tools on Windows, Linux and OSX. The board will be revised once with some of the expensive components replaced by surface-mounted simpler versions. I kind of aimed too high with the first one.


 


/per


 


Astroboxprototype.jpg


Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 25
  • Created
  • Last Reply

Two weeks of operation now on the Balcony without even a hint of a glitch. It controls my power and my focuser right now. The ASCOM drivers are done along with a control application with status and power fiddle possibilities. There is also the roof functions which work fine; albeit with just a loose motor and end-point switches right now.
 
Here are some screen shots (all showing an error for the roof, which is expected as the switches are currently not indicating an end-point and the non-existent roof is not moving).
 
Short description
The box uses three different ASCOM drivers bundled into one "product", the dome driver (for roof), the focuser driver and the safety monitor driver. The latter is a good placeholder for handling the power control via the ASCOM standards' "Action" method. This is a command available in all ASCOM device drivers and lets the driver designer implement arbitrary commands. 
 
The image shows one of the three connect screens, the focuser. All three look the same and will propagate the comport  setting across the devices as they all talk to the same physical device.
 

AboxConnect.png

 
 
After connect of the focuser to the box's com-port, the server (ASCOM local server) starts running upon the actual connect. Should you then connect the dome driver it will not even show the connect dialog as the server is already connected to the device via the focuser, hence the dome driver gets the correct com-port from there and stores it in its profile.
 
The control application
For status and control, I have written a standard windows .NET application that connects to the Safety Monitor driver for the Astrobox. Once connected, it will show a screen with the status of all the devices and let you manually control certain things.
 

AboxMain.png

 
Clicking a power or USB indicator will toggle it. Clicking the orange OPEN or CLOSE buttons will control the roof, and holding the left or right mouse button down on the dew status will increase or decrease the dew heater's power.
 
You will note that the window lacks borders and standard windows form buttons. I wanted my own space age design so I made the main window movable by dragging with the mouse on any non-control part of the window. A right-click on the window will toggle the "always on top" status so that the window will always be on top of any other window of the screen. A double click on the form will minimize it, currently to the task bar, but I will change that to the notification area.
 
The darker square at the top left corner pops out the menu:
 

AboxMenu.png

 
Ever seen a Windows menu with a star-field background? ;)
 
The "Toggle 10Micron Mount" menu entry will toggle one of the Astrobox's outputs that is connected to the remote power on/off input of any mount. They (10Micron ones) need 24V power applied, then a one-second push of a momentary switch (available on the mount and in a plug). For power off, the reverse procedure is used; push the switch, wait until the mount is dead and then turn the 24V off.
 
Re-init to power on state will reset all settings for the box to default.
 
Settings
This is the settings form:
 

AboxSettings.png

 
The "Name" column sets the display texts for the power indicators in the control application's main window. This way you get proper feedback to your status. The "Default" column sets the default power-on state that will be applied to the box once the control application starts. I have my cloud-watcher device connected to Power1 so I need to have it on when the computer is started (it logs in automatically and the control application is in the Startup folder).
 
The "Script command" column is a nice feature that lets you script your power up sequence, in ACP or CCD Autopilot or whatever you use, witth the name of your device without thinking about which power output it is connected to. An example (ok, it's code, but you can understand it :)) in VBScript:

dim boxset box = CreateObject("ASCOM.Astrobox.Safetymonitor")box.Connected = trueif box.Action("Cloud","?") = "off" then    box.Action("Cloud","on")end ifbox.Action("dew","40")

The first section creates a reference to the box's driver.
The second section checks if the power to the cloud detector is on, and if it isn't it turns it on.
The third section sets the dew power to 40%.
 
Now, obviously the use of the control text "Cloud" in the example could also have been "Power1", a name that is always available regardless of your re-configuration of he script commands. But let's assume you want to move the cloud sensor power to Power3. You would re-configure the script command for Power1 to something else and for Power3 to "Cloud". After that, your previous script runs just fine and does the right thing. You do not need to restart anything for the changes to "catch on".
 
 
The focuser drive
The stepper control circuit can handle both bipolar and unipolar motors with 12V rating. Currently, I use Lakeside motors with it with no issues. I have tried with a unipolar stepper from an old printer and that works dandy too. My guess is that whatever stepper you want to throw at it, it will drive.
 
The USB hub
As stated in the first post of this thread, the box has a four-port USB port with external power and data switching on three of the ports. I run the QSI 683 through it at full speed and it hasn't missed a beat. The power/data switching works perfectly and lets me physically unplug and replug devices from anywhere in the world.
 
How many?
I have boards and components for six units right now. I have chosen somewhat expensive components so the next batch will be a re-design with cheaper FETs. I am also contemplating stealing one of the USB ports of the internal hub and add a USB-to-serial chip. I prefer having the box connected with a physical serial port but not all computers have them today. If I do, it will be jumper switchable on/off.
 
The plan is to initially offer the populated boards to anyone who wants them at self cost (board, components, assembly and testing). Since I am not in the business of astro gear it will be the cheapest similar design available, just between hobbyists such as ourselves.
 
Rant, rant...  :lipsrsealed:
 
/per
 
 
Edit: There is no color difference between the forms in reality. I just took some of the screen dumps on my office computer and some via remote desktop (that was set to 16-bit colour only).

Link to comment
Share on other sites

Nick,

I have an ADAM 6017 Ethernet connected power device that I can re-boot the computer with. The processor in the box has a built-in watch-dog timer as well as brown-out protection so the box will always find its way back to life. Besides, it can be physically reset with the DTR line of the serial port controlling it. So, computer resetable physically, box resetable  via software once the computer is up :)

Should work, shouldn't it?

/per

Link to comment
Share on other sites

Thanks,

I do agree about EQAscom but do not find it to be a problem. It is an excellent piece of software and very functional, but yes, it looks a little dated. Bear in mind, though, that the look is sort of the ASCOM standard look and feel ;) It is also the XP look - an operating system that debuted in 2001, twelve years ago...

/per

Link to comment
Share on other sites

Thanks,

I do agree about EQAscom but do not find it to be a problem. It is an excellent piece of software and very functional, but yes, it looks a little dated. Bear in mind, though, that the look is sort of the ASCOM standard look and feel ;) It is also the XP look - an operating system that debuted in 2001, twelve years ago...

/per

In no way am I saying the look makes it a bad program (far from it, it's very fully featured) I just feel that the look and feel of an application is often very important and too often gets ignored. The longer it's ignored the harder it usually is to update and improve as people get so used to the old ways.

Link to comment
Share on other sites

Well, guys, kind words and I will make this project available on a cost basis (parts, board, assembly and testing). It will be cheap enough for you ;)

Nebula, I totally agree. It should be updated, but that may also antail some updates to ASCOM controls which are also a bit old-fashioned albeit still tweakable.

/per

Link to comment
Share on other sites

  • 2 weeks later...

More questions I thought about today, is there a fail safe system built in?

ie: not allowing the roof to close if the scope is not in the park position.

And would you have a wiring example of your observatory with the Astrobox?

thanks

Link to comment
Share on other sites

Haha!

Thanks, Gina!

Olly, I know where I have you...

Gonzo,

The firmware of the box (written i Arduino code) can be expanded to include whatever in terms of roof behavior. The current version considers a stationary roof not at any of the end-points as an error and will signal that. If you give the roof open command, it will accelerate from 30% speed (with full torque) to full in about five seconds, move until it hits the "almost closed" switch, decelerate to 30% and stop at the end-point switch. Same procedure for open.

I use ACP scripting to check that the scopes are parked before actually commencing with a roof close (same with open, actually) if I need it. The France observatory can close the roof with all four scopes pointing in any direction, so there it is not an issue.

The chip itself, ATMega 328, has brownout and watch-dog protection and will restart if it hangs. It has, over a period of several weeks now, never restarted so it should be stable enough.

The next iteration of he hardware is slated for individual current and voltage measurements on all 12V outputs. I am also choosing a cheaper power FET solution as the current one is ridiculously expensive (£6 a piece, and there are 10 on the board). That should be halved when I am done with that.

I am not keeping the Arduino firmware to myself so anyone can take the source code and modify the firmware to fit.

/per 

Link to comment
Share on other sites

Steve,

Thanks! I think most people that want it will modify it if they feel a need for it. I think most of the functionality is already there and should do just fine for most. But if you're like me, it's fiddle first and ask questions later, so I am assuming some questions will be on the way once I get the next version out the door :)

/per

Link to comment
Share on other sites

Haha!

Thanks, Gina!

Olly, I know where I have you...

Gonzo,

The firmware of the box (written i Arduino code) can be expanded to include whatever in terms of roof behavior. The current version considers a stationary roof not at any of the end-points as an error and will signal that. If you give the roof open command, it will accelerate from 30% speed (with full torque) to full in about five seconds, move until it hits the "almost closed" switch, decelerate to 30% and stop at the end-point switch. Same procedure for open.

I use ACP scripting to check that the scopes are parked before actually commencing with a roof close (same with open, actually) if I need it. The France observatory can close the roof with all four scopes pointing in any direction, so there it is not an issue.

The chip itself, ATMega 328, has brownout and watch-dog protection and will restart if it hangs. It has, over a period of several weeks now, never restarted so it should be stable enough.

The next iteration of he hardware is slated for individual current and voltage measurements on all 12V outputs. I am also choosing a cheaper power FET solution as the current one is ridiculously expensive (£6 a piece, and there are 10 on the board). That should be halved when I am done with that.

I am not keeping the Arduino firmware to myself so anyone can take the source code and modify the firmware to fit.

/per 

That's brilliant - I shall probably use it myself when I round to it  :):icon_salut: :icon_salut: :icon_salut: :icon_salut:

Link to comment
Share on other sites

  • 4 months later...

Thanks,

Jonas got the sensor from the US, I do not know which site but I will find out.

/p

I think the sensor is a derivative of one I used in my darkroom meters. It is a light to frequency converter. TSL237

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.