thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: RaspberryPi Camera for Astrophotography

Thu Dec 12, 2013 4:36 pm

Hi Gordon 77,

Unforntunately I did not set the hardware for me, but I'm always very interested in your improvements to the python code.
A friend from our local astronomy club owns the raspberry, camera and some good telescopes, and I want to show him your solution.

Many thanks in advance,
Thomas

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Thu Dec 12, 2013 9:04 pm

thsBavR10 wrote:Hi Gordon 77,

Unforntunately I did not set the hardware for me, but I'm always very interested in your improvements to the python code.
A friend from our local astronomy club owns the raspberry, camera and some good telescopes, and I want to show him your solution.

Many thanks in advance,
Thomas
I'll upload tomorrow. It now uses raspistill as a sub process , set in timelapse mode, storing jpgs as fast at it can.

Gordon77

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Fri Dec 13, 2013 3:52 pm

Here's version k9, and some instructions

I now have the the RPi camera working but you can still use a usb camera, eg Logitech c270 on usb.
I would recommend using the usb and the Arduino Uno interface, not GPIO if using a usb webcam.

I have it working with a NEQ6pro (ST-4) and a Meade LX10, just needs different wiring to the relay interface

Note to EXIT the program always use the RED BUTTON not just close the window.
If you do close the window you'll need to reboot the RPi.


Installing Autoguider 90*
-------------------------

Works with a Raspberry Pi (http://www.raspberrypi.org) with 'Wheezy' using the RPi GPIO outputs (you'll need supply the relay interface) or driving my Arduino Uno interface with USB.

Use the latest RPi Raspian wheezy download.
http://www.raspberrypi.org/downloads

then do

sudo apt-get update
sudo apt-get upgrade
sudo rpi-update

to get the latest upgrades.


Uses IDLE/Python 2.7 . You must start IDLE by using 'startx' to start the GUI, then choose 'LXterminal' and enter 'sudo idle' at the prompt, if not the GPIO won't work

Requires a powered USB hub for the Raspberry Pi to allow connection of keyboard, mouse, suitable webcam and Arduino Uno interface if you dont use the RPI camera.


Unzip and copy the gt90**.py file into /home/pi,

(Note if using an old version the config*.txt files are not compatible, just delete old ones, and use the SAVE configs option to re-write them)

if you are connected to the internet:

Open LXTerminal
type sudo apt-get install python-serial

you may also need fswebcam

type sudo apt-get install fswebcam

In using a PAL composite monitor (as opposed to HDMI) you will need to modfy config.txt on your RPi
remove the # from the following line:

sdtv_mode=2

and to centre the image you may need to remove the #'s from the following lines , and possible change the values:

disable_overscan=1
overscan_left=20
overscan_right=12
overscan_top=10
overscan_bottom=10


Running Autoguider 90*
----------------------

from the prompt type startx
double click LXTerminal
enter 'sudo idle' at the prompt, and press enter
On the Python Shell choose 'File'
Choose 'open'
Choose 'gt90***.py'
click on Open
Choose 'Run'
Choose 'Run Module'

The RPI camera will be enabled (assumed you've installed one and have it enabled and working)

To enable a usb webcam instead change the line in the gt90***.py program to

use_RPiwebcam = 0

If the camera is not connected and you enable it the program will stop with an error.

The GPIO will be enabled unless you change the line in the gt90***.py program to

use_RPiGPIO = 0

The GPIOs used are pins 22 = N, 18 = S, 24 = E, 16 =W

You will need to provide the relay interface to the scope, I can provide some details.

If you want to enable the serial comms to the Arduion Uno interface change the line in the gt90***.py program to

serial_connected = 1

If it's not connected and you enable serial comms the program will stop with an error.

(note Arduion Uno connects as /dev/ttyACM0)

Below the picture you will see the buttons to control the program:
---------------------------------------------------------------

Autoguide - switches autoguide mode on / off

A-Win - Automatically adjusts the size of the tracking window to star size

A-Thr - Automatically adjusts the Threshold level

Log - will log any commands sent to the scope (in /tmp/yymmddhhmmss.txt)

NR - switches on/off noise reduction (averages over 2 frames)

Graph - will show a graph of the stars brightness, showing the max and min values and the threshold set.
(clicking the mouse between these max and min (blue lines) levels will also set the threshold value, assuming you don't have A-Thr on)

Plot - will show a plot of the movement commands required to the Scope.

Thres - will show the detected area of the star, adjusting threshold or enabling A-Thr will change this.

NSi/EWi - inverts the required commands, use if the controls are inverted and guiding moves star away from the target rather than to it.

rgbw +/- selects guide camera channel red/green/blue/white

window +/- sets the size of the window, inc / dec in 32 pixels

Threshold +/- sets the detected level (switch ON Thres to see on display)

interval +/- sets the time (seconds) between commands sent to the scope
(note at times this may automatically increase as required)

Zoom - will switch to 640x480 / 800x600 / 960x720 from the camera, and crop it to 352x288 giving some magnification. This is faster than trying to display a full image.

scale N/S/E/W - sets the required movements of the scope in mSeconds/pixel.
Default set (160) for a 80mm,� FL = 400mm guide scope

scale all - will increment / decrement all scales together

Telescope N,E,S,W will move the scope (1 second pulses)
s in centre is stop - will cancel any existing move command

Window N,E,S,W will move the window in small steps
c in centre will centre target window on centre of the screen.

SAVE config 1/2/3 will save configs to file
RELOAD config 1/2/3 will reload saved configs

sc - will capture a screenshot,
pc - will capture a full resolution picture from the RPi camera (not usb)
note these will be overwritten next time the program runs so move them if you need to keep them

You will also see controls for the RPI camera if you are using that.
Attachments
scope1.jpg
scope1.jpg (64 KiB) Viewed 6463 times
My setup 2.jpg
My setup 2.jpg (27.04 KiB) Viewed 6576 times
Last edited by gordon77 on Sun Dec 22, 2013 4:24 pm, edited 3 times in total.

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: RaspberryPi Camera for Astrophotography

Sat Dec 14, 2013 9:52 am

Great!
many thanks for sharing, have a nice weekend.
Thomas

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sat Dec 14, 2013 2:49 pm

thsBavR10 wrote:Great!
many thanks for sharing, have a nice weekend.
Thomas
OK.

Heres the details of the ST-4 interface and a picture of the Arduino Uno interface.
If you want the Arduino Uno software let me know, it uses the SEEED 4 relay shield.

All at your own risk, I can't be responsible for any errors !!

Gordon77
Attachments
ST-4_interface.jpg
ST-4 interface
ST-4_interface.jpg (22.14 KiB) Viewed 3426 times
st4_4a.jpg
st4_4a.jpg (60.52 KiB) Viewed 6462 times
ST4-5c.jpg
ST4-5c.jpg (28.09 KiB) Viewed 6489 times
Last edited by gordon77 on Thu Jan 22, 2015 11:05 am, edited 1 time in total.

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: RaspberryPi Camera for Astrophotography

Sun Dec 15, 2013 10:36 am

Hello gordon77,
Thank you for the offer.
I assume that we will need a different type of interface for the instruments in our local club.
I currently know the ports of the telescopes too little.

Full ack regarding your hint to risks and errors. Conveniently, some of the collegues have a substantial background in physics and electronics. Most of us are new to raspberry and raspicam, and programming them.
I also have an eye on the threads "RaspiMJPEG" and "RPi Cam Web Interface", this could be an interesting enhancement.

regards, Thomas

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sun Dec 15, 2013 10:52 am

thsBavR10 wrote:Hello gordon77,
Thank you for the offer.
I assume that we will need a different type of interface for the instruments in our local club.
I currently know the ports of the telescopes too little.

Full ack regarding your hint to risks and errors. Conveniently, some of the collegues have a substantial background in physics and electronics. Most of us are new to raspberry and raspicam, and programming them.
I also have an eye on the threads "RaspiMJPEG" and "RPi Cam Web Interface", this could be an interesting enhancement.

regards, Thomas
A lot of scopes have the ST-4 interface which the above 2 designs will drive. Other interfaces can be made, I also use a LX10 which has a non ST-4 interface, but most can be accomodated by wiring changes, and possibly C/O relays as on the SEEED board.

I am trying RaspiMJPEG and can see a little improvement, 500mS instead of 750mS updates, which maybe an advantage, maybe not. I'll keep expertimenting. :D

Gordon77
Attachments
LX10_interface.jpg
Meade LX10 interface
LX10_interface.jpg (50.76 KiB) Viewed 6427 times

edjuh
Posts: 18
Joined: Sat Dec 21, 2013 12:38 pm

Re: RaspberryPi Camera for Astrophotography

Sat Dec 21, 2013 12:42 pm

just stepped in, have to catch-up on the thread, sorry to jump in so late :oops:

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sun Dec 22, 2013 4:31 pm

Updated version of autoguide software.
Same instructions as earlier but amendments

Telescope N,E,S,W will move the scope (1 second pulses)
c will try to centre target star in window by moving the scope (Autoguide must be ON)
Stop - will cancel any existing move command

Window N,E,S,W will move the image in the window in small steps
c in centre will try to centre target window on centre of the screen, won't move the scope
You must have zoom > 0

RELOAD and CONFIG updated so old copies of config1,2,3.txt wont work, use SAVE first

Gordon77
Last edited by gordon77 on Sun Jan 19, 2014 8:16 pm, edited 2 times in total.

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Fri Jan 03, 2014 5:15 pm

I see a few people have downloaded this, and previous versions, anyone got a system working ?

Anyone found any issues ?

I continue to develop it.

Gordon77

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sat Jan 11, 2014 5:09 pm

Latest version
Now uses raspistill -roi option, so faster
New keys layout
You can now change the size of the viewing window, set 'Image_window' in program
Screenshot shows Image_window = 1 ( 640x480).
(This is a test card I use for check RGB filtering)
Simulation fixed (set 'camera_connected = 0' in program to see)
NR and eV removed
A-Int (auto Interval) added
More exposure modes available (but they are not much use for astro!)
More levels of zooming, you will see the pi camera zooming effect unless you download Jamesh's latest software with Sudo rpi-update
Attachments
screenshot.jpg
Screenshot
screenshot.jpg (60.47 KiB) Viewed 5520 times
Last edited by gordon77 on Thu Jan 22, 2015 11:06 am, edited 1 time in total.

Hummer
Posts: 40
Joined: Thu Jan 09, 2014 9:55 pm

Re: RaspberryPi Camera for Astrophotography

Sun Jan 12, 2014 8:39 pm

Hi Gordon77,
I have just started using a Raspberry Pi ( have played with Arduino Unos and Pics before). Your project really grabbed my interest as I am currently taking astrophotos with a Canon T3i on an eq3-2 mount. So far I have run gt901m.py in demo mode. Will it be possible/practical to run the Pi headless using VNC while using your program?


Daniel
Toronto, Ontario
Canada

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Mon Jan 13, 2014 10:57 am

Hummer wrote:Hi Gordon77,
I have just started using a Raspberry Pi ( have played with Arduino Unos and Pics before). Your project really grabbed my interest as I am currently taking astrophotos with a Canon T3i on an eq3-2 mount. So far I have run gt901m.py in demo mode. Will it be possible/practical to run the Pi headless using VNC while using your program?


Daniel
Toronto, Ontario
Canada
Hi,

I am afraid I don't know the answer, I've never tried the Pi headless. I would be interested to know !.
I am sure others on here will know. It simply uses Python 2.7, with pygame graphics, RPiGPIO or USB, and the pi camera.

If you have any questions about the program please ask, I realise I haven't written full instructions

Gordon77

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sun Jan 19, 2014 8:15 pm

At last some clear sky !!

Screenshot and a 5 minute exposure in Orion, taken on a Canon 7D, with 400mm lens, mounted on a NEQ6 pro, with a 80mm scope guided with the Pi. Very little processing just Brightness and Contrast adjusted.

Gordon77
Attachments
Image8b.jpg
Processing - noisy Horsehead
Image8b.jpg (59.06 KiB) Viewed 5220 times
Image3.jpg
5 min exposure @ 800 ISO
Image3.jpg (61.98 KiB) Viewed 5336 times
screen10a.jpg
screen10a.jpg (39.24 KiB) Viewed 5335 times
Last edited by gordon77 on Tue Jan 21, 2014 1:53 pm, edited 3 times in total.

Hummer
Posts: 40
Joined: Thu Jan 09, 2014 9:55 pm

Re: RaspberryPi Camera for Astrophotography

Sun Jan 19, 2014 11:11 pm

My Guider so far has a Raspberry Pi attached to a Pi camera with a 6x26 scope. I run it headless using TightVNC. My next step is to attach it to the mount. Is the software setup so I could attach opticouplers to the GPIO pins and thus control the mount?

Daniel

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Mon Jan 20, 2014 4:05 am

Hummer wrote:My Guider so far has a Raspberry Pi attached to a Pi camera with a 6x26 scope. I run it headless using TightVNC. My next step is to attach it to the mount. Is the software setup so I could attach opticouplers to the GPIO pins and thus control the mount?

Daniel
Yes, here's an example circuit from an earlier mail

Please note that using any software or any interface designs l have uploaded is at your own risk. I have tested it on my own equipment. Please take care when interfacing to any equipment, eg a telescope, camera, to ensure you do not damage them.

Gordon
Attachments
ST-4_interface.jpg
ST-4_interface.jpg (22.14 KiB) Viewed 3434 times
Last edited by gordon77 on Thu Jan 22, 2015 11:07 am, edited 2 times in total.


gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Mon Jan 20, 2014 1:58 pm

The GPIO outputs are enabled in the programme with the line
use_RPiGPIO = 1
Enabled is the default.

You can change to any GPIOs you want by modifying the following lines, just change the pin numbers
N_OP = 22
S_OP = 18
E_OP = 24
W_OP = 16

Gordon

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Fri Jan 24, 2014 10:21 am

M42
Canon 7D with 400mm lens, on NEQ6pro.
5x7min + 1x5min exposure @ ISO800
Guided by 80mm scope using Raspberry Pi and Pi camera and my program.
Processing in Paint Shop Pro 9 and DeepSkyStacker

Gordon77
Attachments
M_42.jpg
M42
M_42.jpg (55.12 KiB) Viewed 5156 times
Last edited by gordon77 on Fri Jan 24, 2014 2:19 pm, edited 1 time in total.

FliX80
Posts: 2
Joined: Fri Jan 17, 2014 5:23 pm

Re: RaspberryPi Camera for Astrophotography

Fri Jan 24, 2014 10:48 am

Great job!

I am really thankfull for your work!

Do you think, it is possible to direct connect the pi via eqmod and USB (maybe via indi) to the synscan and use your autoguider?

Steering the synscan with kstars works great, but using the camboard doesn't work. :(

Greets!

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Fri Jan 24, 2014 3:39 pm

FliX80 wrote:Great job!

I am really thankfull for your work!

Do you think, it is possible to direct connect the pi via eqmod and USB (maybe via indi) to the synscan and use your autoguider?

Steering the synscan with kstars works great, but using the camboard doesn't work. :(

Greets!
I wish I knew the answer but I'd need to do some research into those packages.
My autoguider can output GPIO switching, or LX200 commands through the USB.
What would it need to output to EQMOD ?

Gordon

FliX80
Posts: 2
Joined: Fri Jan 17, 2014 5:23 pm

Re: RaspberryPi Camera for Astrophotography

Fri Jan 24, 2014 3:54 pm

Hi Gordon,

as far as i know, eqmod is just doing the job which the hand controller is usually doing. It sends serial commands to the mount.
I don't have any deep information, how exactly eqmod "talks" to the mount. Maybe, their homepage has some kind of information for you? Sorry to tell, but I am not a software engineer. :-(

EQMOD Home: http://eq-mod.sourceforge.net/introindex.html

indilib home: http://www.indilib.org/

Greetings

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Fri Jan 24, 2014 4:24 pm

FliX80 wrote:Hi Gordon,

as far as i know, eqmod is just doing the job which the hand controller is usually doing. It sends serial commands to the mount.
I don't have any deep information, how exactly eqmod "talks" to the mount. Maybe, their homepage has some kind of information for you? Sorry to tell, but I am not a software engineer. :-(

EQMOD Home: http://eq-mod.sourceforge.net/introindex.html

indilib home: http://www.indilib.org/

Greetings
On first look I am not sure how my program would interface with either of these and what it could offer.
I am simply making use of the mount autoguider port to make minor corrections, and as such it is completely standalone not needing any drivers etc. Maybe in future I'll understand it more.

Gordon

Hummer
Posts: 40
Joined: Thu Jan 09, 2014 9:55 pm

Re: RaspberryPi Camera for Astrophotography

Sun Jan 26, 2014 7:45 pm

Hi,
I have finished building the autoguider and modified the mount controller. Next step is to test the setup. Thanks for the great project.

Daniel
Attachments
20140126_143742_crop.jpg
20140126_143742_crop.jpg (38.62 KiB) Viewed 5068 times

gordon77
Posts: 4173
Joined: Sun Aug 05, 2012 3:12 pm

Re: RaspberryPi Camera for Astrophotography

Sun Jan 26, 2014 8:18 pm

Hummer wrote:Hi,
I have finished building the autoguider and modified the mount controller. Next step is to test the setup. Thanks for the great project.

Daniel
Excellent.

Gordon

Return to “Camera board”