[ASTROPHOTO] Autoguiding using an old webcam and an arduino

Congratulations for your work

I am new on this forum; i am amateur in astronomy and i live in the north of france.
Arduino is very interseting to make small dyi projects.
Your application for small astronmical mount tracking is very intersting so i should want to realize it with my canon 550d on my eq1.
Can you give me more information aabout the system: wiring between stepper motor and driver controler, and with arduino pins and webcam (schematix picture if possible) and how start and stop the system.
I try to animate a small group but in north of france the sky is often cloudy!

Have a good day

This is very nice work, I am no good at ASCOM drivers so I am re-using the ASCOM driver posted here.

However when using OpenPHD2 2.1.3a I was getting errors "ascom driver failed checking slewing" every time a guide pulse is sent to the mount?!?!? and I have to click the OK button on the error box that pops up.

Apparently a fix was added in OpenPHD 2.3.0 which allows PHD2 to ignore this type of error. When I upgraded to 2.3.1 the error still pops up but I now can guide. My challenge now is getting PEC working.

vendinleciel:
Can you give me more information aabout the system: wiring between stepper motor and driver controler, and with arduino pins and webcam (schematix picture if possible) and how start and stop the system.

Salut ! Je ne suis pas chez moi en ce moment, je ne peux donc pas te donner exactement la schématique du montage. Cependant, tout se trouve sur le net ainsi que dans mon code. Pour les branchements moteur-stepper driver tu peux regarder ici. La webcam est une webcam standard qui se branche via USB. Nimporte laquelle devrait faire l'affaire, a condition qu'elle permette de bien voir les étoiles (éventuellement changer l'objectif, comme je l'ai fait). Le reste du controle se fait avec OpenPHD, il y a des tutoriels sur le net ! Hésite pas si tu as des questions, j'essairai de répondre !

orly_andico:
However when using OpenPHD2 2.1.3a I was getting errors "ascom driver failed checking slewing" every time a guide pulse is sent to the mount?!?!? and I have to click the OK button on the error box that pops up.

This is possibly due to my lazyness, I only implemented the PulseGuide functions in the driver. If openPHD tries to slew the mount, it will fail because it will not respond. Do no try to slew the mount within openPHD. FYI I'm using openPHD 2.2.2g.

orly_andico:
Apparently a fix was added in OpenPHD 2.3.0 which allows PHD2 to ignore this type of error. When I upgraded to 2.3.1 the error still pops up but I now can guide. My challenge now is getting PEC working.

Good luck ! Don't hesitate to ask me stuff if you have any questions !

Hi Luca, I'd like to try a solution very close to your project. I'd like to use an EyeToy Silver (PS2, Namtai CMOS VGA resolution). Do you utilized an EyeToy as well? It seems to me that you mounted an standard 50mm lens in front of the webcam. How well your set up performed during autoguiding? I suppose your EyeToy was modded by removing the original lens group, right?
Gigi

Hi Gigi,

Yes, I also used a PS2 eyetoy camera, black version though :wink: I removed the PCB from the housing and made a custom 3d printed housing designed to work with a 50 mm lens, for three reasons:

  • The focal length of the original plastic lens is way too short (wide angle)
  • The aperture is very low, it would have been difficult to get any stars
  • The optical quality is poor.

I used an old 50mm f1.4 yashica lens (which BTW is extremely sharp!) instead, and it works well. The autoguiding part works very well, however the mount I used is crappy, so that's the area where currently I can improve the most.

Good luck!

Thanks Luca for your response! I also removed the PS2 lens and made a simple adapter for my Nikon lenses (see here). The idea is to use a 400mm Sigma to take astrophotos and a 200mm as guiding scope (here) not tested yet. My doubt is that 200mm for guiding is too much ... you use a 50mm :o
Gigi

Bonjour

J'ai réaliser le montage, mais ma monture n'est pas exactement la même que celle que tu utilises; de plus mon moteur pas à pas est un 200 pas.

Dans ta formule:
//Fixed track rate
// 1 day = 86'400'000 ms
// 1 day = 1 big wheel turn = 100 small screw turns
// 1 screw turn = 864'000 ms
// 1 screw turn = 1 motor turn = 400 steps * 16 (microstepping)
// 1 motor step = 135 ms
// Timer1 OCR : 1000ms = 15625 units
// 15.625*135 = 2109.375 = 2109 (value for 1.0x sidereal rate)

à quoi correspond: Timer1 OCR : 1000ms = 15625 units et dans mon cas y a t il quelque chose à changer?
à part mettre 200 à la place de 400 et modifier le calcul avec la valeur induite par mon big wheel turn?

Bonne soirée

GigiG:
My doubt is that 200mm for guiding is too much ... you use a 50mm :o

Nice setup you have there. Yes, 200mm is going too much if you have a 400mm lens on the main camera. I think a lense somewhere between 50-100mm should do the trick. Use the brightest lens available.

vendinleciel:
Bonjour

J'ai réaliser le montage, mais ma monture n'est pas exactement la même que celle que tu utilises; de plus mon moteur pas à pas est un 200 pas.

Dans ta formule:
//Fixed track rate
// 1 day = 86'400'000 ms
// 1 day = 1 big wheel turn = 100 small screw turns
// 1 screw turn = 864'000 ms
// 1 screw turn = 1 motor turn = 400 steps * 16 (microstepping)
// 1 motor step = 135 ms
// Timer1 OCR : 1000ms = 15625 units
// 15.625*135 = 2109.375 = 2109 (value for 1.0x sidereal rate)

à quoi correspond: Timer1 OCR : 1000ms = 15625 units et dans mon cas y a t il quelque chose à changer?
à part mettre 200 à la place de 400 et modifier le calcul avec la valeur induite par mon big wheel turn?

Bonne soirée

Hello.

Tous d'abord, il y a une petite erreur dans mon texte. Une rotation complete de la terre prend 23h56m04s et non 24h comme écrit. Partons donc avec comme objectif un "tour de monture" en 23h56m04s. Supposons que la grand roue (je ne connais pas le nom exact :slight_smile: ) a 100 rainures. Il faut donc 100 tours de petite vis pour tourner de 360 degrés. Regle de trois, on trouve qu'il faut faire un tour de petit vis toutes les 86164/100 = 861.64s. Ton moteur a 200 pas par tour. Il te faut encore savoir si tu fais du full-step, half-step ou microstepping comme moi (je divise un pas par 16...). Je vais supposer que tu fais tu half-stepping ici. Tu as donc 200*2 pas par tour. Il faut donc faire un pas tous les 861.64/400 = 2.15 secondes.

Pour créer le signal qui steppe ton moteur, tu utilises un compteur qui va de 0 à 65535 (16 bits) en 8388.608 millisecondes. (Voir ici pour details, prescaler = 1024: Arduino Playground - HomePage).

Si tu veux attendre 2.15 secondes, il faut donc configure le timer compare match register à une valeur correspondant à 2150ms. Celle ci est (regle de trois...) : (2150/8388)*65535 = 16797.8 = 16798.

Tu peux donc definir trackRate = 16798. trackEast doit etre plus grand (=ralentir le mouvement), trackWest doit être plus petit (=accelerer).

J'espère avoir été a peu près clair. De toute manière tu peux définir une valeur puis regarder si ça marche, et changer au besoin.

A+

I'm in the early phases of designing and building my own mount (powered by stepper motors) and this is a huge help!

I'm pretty new to this all though, and have a few questions:

I'm planning on 2-axis guiding (both RA and DEC). How can this be changed to work with a dual-axis guiding system? I can probably figure out how to tweak the arduino code myself, but will the ASCOM driver still work? How would I need to change that?

Also, out of curiosity since I'll need to be buying my own, which pololu stepper driver did you use?

Thanks!

tksandy:
will the ASCOM driver still work? How would I need to change that?

In the ASCOM driver, you have to change line 640, add the north and south direction to the PulseGuide method. See the manual.

In the arduino code you'll have to add the entire DEC axis control code, but you can basically copy what I did for the RA axis.

Sorry I really skipped a lot of stuff and went for the essential part for my project :slight_smile:

Regarding the polulu stepper driver, I think I have the 2amps version that can do 16x microstepping

What are your PHD2 settings? Im trying to connect a normal webcam but the screen is always black, and also the mount, i am also using an EQ1 but dont know what so select, i actualy havent found any tutorial about the PHD guiding :frowning:
And also, your webcam, can you do a long exposure for guiding or is the lens powerful enough to colect enough light so the sensor of the camera catches it?

Thank you, awsome idea and great work :slight_smile:

Trying to compiler your C# code.
Using Microsoft Visual Studio.
I got over 60 errors.
I added the Platform 6 Developer Component dlls for Platform6
I am down to four errors.
I get the following errors messages:

Error	1	The type or namespace name 'SetupDialogForm' could not be found (are you missing a using directive or an assembly reference?)	c:\users\vrx\documents\visual studio 2013\Projects\arduinoMount\arduinoMount\Driver.cs	122	20	arduinoMount

Error	2	The type or namespace name 'SetupDialogForm' could not be found (are you missing a using directive or an assembly reference?)	c:\users\vrx\documents\visual studio 2013\Projects\arduinoMount\arduinoMount\Driver.cs	122	44	arduinoMount

Error	3	'ASCOM.ArduinoMount.Telescope.AxisRates(ASCOM.DeviceInterface.TelescopeAxes)' is a 'method' but is used like a 'type'	c:\users\vrx\documents\visual studio 2013\Projects\arduinoMount\arduinoMount\Driver.cs	346	24	arduinoMount

Error	4	'ASCOM.ArduinoMount.Telescope.TrackingRates' is a 'property' but is used like a 'type'	c:\users\vrx\documents\visual studio 2013\Projects\arduinoMount\arduinoMount\Driver.cs	890	52	arduinoMount

No idea what to do next.

Regarding, "Im trying to connect a normal webcam but the screen is always black,"

I had the same problem. You have to select the camera with the camera icon lower left. Then you have to press the looping icon which, if I remember correctly, is the third from the left. It looks like a looping horizontal arrow. Then you start getting video from the web cam.

Nice work and thanks for sharing.

I was working on a single drive axis Arduino controlled for EQ1. But no ST4 interface.

A very cheap 28byj stepper with interface and Arduino Uno.

Sideral day of 23h56m04.1s must be consider instead of a solar day of 24h00m00s. This must be done because at the same time Earth do a complete rotation we advance almost one degree (1/365.25) around the Sun orbit.

Well, a lot of calculation could be implemented If you consider the Earth's eliptic orbit and even VSOP 87 theory for planetary position to know the real sideral day length but It appears to be ok.

In time: How do autoguider works with one axis only?!

Hello,
I am getting an error "ASCOM driver failed checking isPulseGuiding" when running PHD 2. I have an Arduino UNO connected to a Big Easy Driver to a NEMA 17 Stepper motor that is attached to the RA worm gear shaft.
I'm sure I missed something here. Any help is, very much, appreciated.

Hey,

I wanted to do this as a project for university and this post actually helped me a lot.

In my case, I expanded the code for RA and DEC tracking using the EasyDriver and two NEMA 17 1.8 deg motors. I also implemented the slewing feedback to get rid of the error message. Heres the github link: GitHub - mattisky/Arduino_Ascom_Project: Autoguiding Project with an Arduino Board (driver credits: https://github.com/ejholmes/Arduino-Telescope--ASCOM-Driver-/find/master) .I'm glad if this might help somebody and if you have questions go ahead.

Matti

skymattisky:
Hey,

I wanted to do this as a project for university and this post actually helped me a lot.

In my case, I expanded the code for RA and DEC tracking using the EasyDriver and two NEMA 17 1.8 deg motors. I also implemented the slewing feedback to get rid of the error message. Heres the github link: GitHub - mattisky/Arduino_Ascom_Project: Autoguiding Project with an Arduino Board (driver credits: https://github.com/ejholmes/Arduino-Telescope--ASCOM-Driver-/find/master) .I'm glad if this might help somebody and if you have questions go ahead.

Matti

Hey there!

How do I compile this .cs-file correctly?

When I do it, I get a bunch of errors calling out missing references to ASCOM.

Greetings!

Very interesting project!
Did you consider interfacing CCD chip (TC237 in particular) to Arduino, so the sketch can guide the mount via ST-4 interface (OnSTEP, for example), completely stand-alone?

Some time ago I did something similar (it was for another application, with one of Philips processors), there was also very primitive "star" detection (assumed round illuminated shape, treshold was at 50% level from CCD chip), it sort of worked..)