TheSkyX and dithering a Nikon DSLR
- StellarSnaps

- May 23, 2018
- 3 min read
Thankfully TheSkyX supports Nikon DSLRs by interfacing with Backyard Nikon (https://www.otelescope.com/store/product/4-backyardnikon-10-premium-edition-otl-byn-p/). The caveat is, in order to perform a dither, the telescope must be connected to Backyard Nikon through ASCOM. While ASCOM is widely used in astrophotography setups, I've found that multiple devices connected through ASCOM have resulted in 'connected device errors' (whenever possible, I always use the native device drivers). Therefore, I needed to find an alternative solution to dithering and capturing.
An alternative to Backyard Nikon is another software package called ControlMyNikon (https://www.tetherscript.com/controlmynikon-home/). Reading through the documentation of ControlMyNikon I found that local or remote trigger commands can be sent over TCP/IP to control many of the connected camera features (ControlMyNikon has a built in TCP/IP server). I thought if I could command TheSkyX to dither the telescope followed by sending capture commands to ControlMyNikon via TCP/IP, that this strategy might be a viable alternative solution. To implement, however, it would require some programming.
I settled on using VBScript to script TheSkyX, and JavaScript (node js) to trigger the DSLR. Talking to a fellow astrophotographer friend (Dusty Von Handorf), Dusty suggested a randomized dithering strategy as opposed to a dither geometry (circular, spiral, etc..). It would be fairly easy to implement.
After 2 days of programming I now have a working script that is fully tested. This is the procedure I took:
---
Dithering - VBScript
The Nikon d700 with the mounted Sigma 85 mm f1.4 has an image scale of 20.23 arcseconds/pixel. I chose to programmatically set the min dither amount to 10 pixels, and the maximum to 20 pixels. This produces a min and maximum dither of ~ 203 and 406 arcseconds, respectively. I generated a random number (non-integer) bounded by the min and max dither value for both the RA and DEC axes, and either added or subtracted the random dither value to the starting image RA/DEC coordinates. The choice of adding or subtracting the dither from the RA/DEC was also randomized. A new randomized (integer) value for both the RA and DEC was generated and the modulus was taken to determine if the random value was even or odd. Even meant the dither was additive, and odd subtractive.
TheSkyX - VBScript
Once the randomized dither value was generated and randomly added or subtracted from the image start coordinates, TheSkyX was commanded to slew to the new RA/DEC coordinates. A 'wait' function was added to allow the dithering to settle (20 secs). Post-dithering, the VBScript called a JavaScript whose function is to open TCP/IP and connect to the TCP/IP server running on ControlMyNikon.
DSLR trigger - JavaScript
ControlMyNikon supports many ways to trigger the connected DSLR (web, TCP/IP, motion, sound, etc.) for capturing. I selected to trigger the camera for capture using commands sent over TCP/IP. To do this, the JavaScript connects to the host ip and port (the d700 was connected to another computer within the local network) that the TCP/IP server is running on. Commands were sent over TCP/IP to trigger the camera shutter for image capture. Post-capture, the entire process was repeated (dither, slew, camera trigger) until the desired number of images were taken.
In the future the dithering script will be modified to evaluate other dithering algorithms.
---
After reading this you are likely thinking that all of my efforts could have been circumvented if I chose to use ASCOM. While true, however, this mental exercise taught me about TheSkyX scripting and websockets. I'm sure all of this mental gymnastics will come in handy when I need to implement a particular imaging task for which no software package exists.





Comments