Jump to content


Photo

DIY digital setting circles

  • Please log in to reply
35 replies to this topic

#26 StarDusty

StarDusty

    Ranger 4

  • -----
  • Posts: 341
  • Joined: 02 Oct 2007
  • Loc: Parsippany, NJ

Posted 18 August 2013 - 09:10 AM

I tried to put as many different DSC communication codes in my PIC firmware as I could find online. I did some research at the time. I emulated Ek's codes and some others. The DSC system is passive. It just counts encoder ticks up or down all night long. It only transmits that data via a serial link to the computer connected to the "black box". The computer might be a Palm Pilot, a PC, or now a Smartphone or Tablet. Most of the hard calculations needed to make the DSC complete are on the Computer side of this system. To rewrite that part would be a heavy lift....

Here are the Codes my PIC system can interpret along with the PIC's reaction to same.



//Receive "y" send encoder positions
case 'y':
buf[0] = lobyte(Alt);
buf[1] = hibyte(Alt);
buf[2] = lobyte(Az);
buf[3] = hibyte(Az);
sendMessage(buf,4);
break;

//Receive "h" send encoder resolution
case 'h':
buf[0] = lobyte(AltRes);
buf[1] = hibyte(AltRes);
buf[2] = lobyte(AzRes);
buf[3] = hibyte(AzRes);
sendMessage(buf,4);
break;

//Receive a "z" set and save encoder resultion in PIC
case 'z':
Altlo=getc();
Althi=getc();
Azlo=getc();
Azhi=getc();
AltRes=make16(Althi,Altlo); //Make 16 bit number
AzRes=make16(Azhi,Azlo);
AltDelt=AltRes/2;
AzDelt=AzRes/2;
buf[0] = 'r';
sendMessage(buf,1);
break;

//SOME OTHER SYSTEM CODES
//Receive a "Q" send be encoder positon in specific format
case 'Q':
AzMG=Az;
AltMG=Alt;
if(Az>AzDelt) AzMG=-(AzRes-Az);
if(Alt>AltDelt) AltMG=-(AltRes-Alt);
sprintf(buf, "%06Ld\t%06Ld\r", AzMG, AltMG);
length = strlen(buf);
if(AzMG>=0) buf[0]='+';
if(AltMG>=0) buf[7]='+';
sendMessage(buf,length);
break;

//Receive a "Z" set encoder resolutions also sends back a "*"
case 'Z':
for(i = 0; i<15; i++)
{
buf[i] = getc();
}
buf[7] = 0;
buf[14] = 0;
AltRes = atol(&buf[9]);
AzRes = atol(&buf[2]);
AltDelt=AltRes/2;
AzDelt=AzRes/2;
buf[0] = '*';
sendMessage(buf,1);
break;

//YET ANOTHER SYSTEMS CODES
//Receive a "I" send encoder positions in a specific format
case 'I':
for(i = 0; i<14; i++)
{
buf[i] = getc();
}
buf[6] = 0;
buf[13] = 0;
Alt = atol(&buf[9]);
Az = atol(&buf[1]);
buf[0] = '1';
sendMessage(buf,1);
break;

//Receive a "r" A different way to send encoder positions
case 'r':
sprintf(buf, "%05Lu\t%05Lu\r", AzRes, AltRes);
length = strlen(buf);
sendMessage(buf,length);
break;

Receive a "a" send back a "Y"
case 'a':

buf[0] = 'Y';
sendMessage(buf, 1);
break;

Recieve a "R" send back encoder resolutions in a specific format
case 'R':
buf[0]= getc();
if (buf[0]=='+') {
for(i = 1; i<14; i++)
{
buf[i] = getc();
}
buf[6] = 0;
buf[13] = 0;
AltRes = atol(&buf[8]);
AzRes = atol(&buf[1]);
}
else {
for(i = 1; i<12; i++)
{
buf[i] = getc();
}
buf[5] = 0;
buf[11] = 0;
AltRes = atol(&buf[6]);
AzRes = atol(&buf[0]);
}
AltDelt=AltRes/2;
AzDelt=AzRes/2;
buf[0] = 'R';
sendMessage(buf,1);
break;

#27 Dale Eason

Dale Eason

    Explorer 1

  • -----
  • Posts: 91
  • Joined: 24 Nov 2009
  • Loc: Roseville,Mn.

Posted 18 August 2013 - 10:57 AM

Another option is to use an Android tablet like the Google Nexus 7 or Nexus 10. They have a free program called SkyEye that monitors the tilt of the tablet and knows where it is pointing. Turns out it is accurate enough to find the Messier objects in an eyepiece of a Dob. You can mount it on the scope and align it to at least one star. Then it knows how it is oriented and where the scope is pointing. SkyEye has a small data base of stars and the Messier objects.

The Nexus 7 is only $250 dollars. I was very impressed with its capabilities. I have argo navis and Servo cat on my scope so I do know what some of the best systems can do. I tired this out on another scope and was surprised by how well it worked.

For those that can write programs this is a good option since you can access all of those sensors yourself and create your own modifications. For your project the neat thing is that you would not need to connect encoders to the axis of the scope. For visual work it is accurate enough to find the object at low power. It might not be accurate enough to track it. I don't know the resolution of the sensors.

Dale Eason

#28 Aaron Small

Aaron Small

    Lift Off

  • -----
  • Posts: 1
  • Joined: 27 Sep 2012

Posted 18 August 2013 - 01:32 PM

I recently used these capacitive encoders with a Ek DSC box on my C8. Very easy to install to the scope with minimal modification. They adapt easily to any access shaft (machine screw) so I would think they would be easily adaptable for others.

Probably going to get these same encoders for my ATM Dob instead of modifying the encoders from a couple of MS mice.

#29 NHRob

NHRob

    Aurora

  • *****
  • Posts: 4888
  • Joined: 27 Aug 2004
  • Loc: New Hampshire

Posted 18 August 2013 - 07:27 PM

I picked up two capacitive encoders and am building DSCs around an Arduino clone. It will be Bluetooth-wireless to my Nexus 7 running Sky Safari. I have one axis working now and just need to add the 2nd axis and get that debugged.

#30 windjammer

windjammer

    Lift Off

  • -----
  • Posts: 18
  • Joined: 02 Jun 2013

Posted 19 August 2013 - 04:37 PM

Hi Jeff -

Well, David and Stardusty have given a pretty good spec on what is needed to speak to one of these eeks (thanks very much!). I'll put it on my list of upgrades but can't say when I might get round to it. I want to fix a few bugs first, clean it up, 2 star align etc etc. I don't actually possess one of these eek beasties anyway !

Major issue at the moment is the wife-required great summer DIY marathon on the house, so my spare time is a bit limited for a while....

Re adding extra detectors in the encoder, I think that is a good idea, although another 90d phase offset would put you 180d from the first detector, which would supply no further information. So the phase offsets should not be 90d - which as you say is easily done. On a different tack I experimented with putting the analogue sensor outputs through the D/A converters on the arduino as a way of generating extra encoder ticks. The full 10bit A/D conversion cycle takes an age, but to simply generate an extra 8/16 or 32 steps is much faster. Being able to do this would mean one could remove some of the gearing, which would improve accuracy and backlash. I never bottomed out completely on this approach - maybe mark 2.

Simon

#31 StarDusty

StarDusty

    Ranger 4

  • -----
  • Posts: 341
  • Joined: 02 Oct 2007
  • Loc: Parsippany, NJ

Posted 19 August 2013 - 09:03 PM

Just as a double check, I went back to Dave Ek's website. Here is a screen shot of his original Communication Protocol.

Attached Files



#32 Matt W.

Matt W.

    Lift Off

  • *****
  • Posts: 6
  • Joined: 02 Oct 2011

Posted 27 November 2013 - 03:40 PM

This is what I built last summer, DSC + Wifi to use with SkySafari on iOS, but would probably work with any Serial over WiFi solution out of the box, or with software mods.

https://github.com/mdw123/arduino-dsc

Uses an Arduino, a WiFly board and the AMT capacitive encoders, which work great once you epoxy the slip out of the plastic parts that connect the encoders to the shaft.

The WiFly sets up an access point that you connect to, so it can be used in the field without any additional hardware other than your phone or tablet. An 8Ah sealed lead-acid battery could easily run the DSC circuit and my fan from sunset to sunrise.

The only warning is to use a digital voltage regulator to reduce the input voltage to the circuit as close to lowest voltage allowed by the Arduino so you don't overload the heat-dissipating capacity for the arduino's voltage regulator, due to the somewhat power-hungry WiFly. Based on what I've read, it should be able to easily handle the WiFly's draw as long as you don't power the Arduino at too high of a voltage. I bought an automotive adapter for $10 or so at one of the local stores.

Matt

#33 orlyandico

orlyandico

    Fly Me to the Moon

  • *****
  • Posts: 5268
  • Joined: 10 Aug 2009
  • Loc: Singapore

Posted 28 November 2013 - 01:28 AM

http://orlygoingthir...ital-setting...

DSC + Bluetooth for use with Skysafari. I don't claim originality of code, I used Mike Fulbright's DSC code - http://msfastro.net/...les/arduinodsc/ - the difference is I do quadrature on both encoders, and use PinChangeInt to get around the Uno's lack of interrupts (ideally you'd want 4 hardware interrupts).

#34 Matt W.

Matt W.

    Lift Off

  • *****
  • Posts: 6
  • Joined: 02 Oct 2011

Posted 28 November 2013 - 02:21 AM

Yep - my code is forked from from https://github.com/m...eel/arduino-dsc - the repo based on your code, right?

Works very well, except that code didn't work with SkySafari out of the box, due to if I remember correctly carriage returns and some of the commands it implemented caused SkySafari to not be able to connect. You probably have something different than that repo?

I ended up separating the initialization of the WiFly from the DSC code because of the issues with Arduino performance of software serial, which is how all of the WiFly libraries are set up. That way, bluetooth, WiFly or serial, everyone can use the same code.

Shaft expoxy and 4x interrupts definitely helped the performance.

#35 orlyandico

orlyandico

    Fly Me to the Moon

  • *****
  • Posts: 5268
  • Joined: 10 Aug 2009
  • Loc: Singapore

Posted 28 November 2013 - 02:49 AM

Honestly I haven't touched my code since I wrote it (since it worked fine for me). The code from github is probably more developed/fixed, and I expect yours is more developed still.

I'm planning to get started on my DIY GoTo using an Arduino and LadyAda motor shield real soon now though (the use of an existing shield means zero soldering).

#36 Matt W.

Matt W.

    Lift Off

  • *****
  • Posts: 6
  • Joined: 02 Oct 2011

Posted 02 December 2013 - 01:27 AM

will be interesting to see what you build!






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics