Enginursday: Tracking Stars

No, we're not talking about hiding in bushes with long zoom lenses waiting to see what Tom Cruise is wearing today...

Favorited Favorite 3

Like many people on Earth, I love stargazing and imagining all the possibilities that lie in the vast expanses of the universe. As a gearhead, tech nerd and maker I have taken that fascination and tried to express it through astrophotography. Until recently, I've been able to get increasingly clear, bright, and awe-inspiring shots just by improving my technique using tools I already have. Now, however, I have encountered a new foe: physics.

There's a lot of physics going on when you look at the stars. Fusion is releasing huge amounts of EM radiation from distant clumps of gas. Those waves travel through the vacuum of space, are bent by gravity, dispersed by vast clouds of gas and illuminate countless worlds. Our planet rotates on an axis while orbiting the Sun, which is caught in a milky whirl pool that floats lazily amongst trillions more. It's all quite messy, really!

Most of that stuff doesn't matter for astrophotography because exposures are typically short - from a few minutes to a few hours. The translation of the Earth over that period does not change the appearance of the sky, but one thing - the Earth's rotation - has a huge effect.

star trails
All In A Spin Star WikiMedia Commons

A lot of photons are needed in order to capture an image of a faint object in the sky. That means a lot of time spent photon-hunting (or gathering, whichever you prefer). And with the Earth spinning right round at 360 degrees per day, it won't be long until your star is smeared right across the image. This became my limiting factor, so I decided to build a solution.

Star Trackers

Star trackers are devices used to counteract the rotation of the Earth so long-period observations of the sky can be performed. The concept is simple: make a platform that rotates against the Earth at the same rate. Designs for star trackers range from Ford Pinto to Rolls Royce, and there are plenty of resources online about how to make your own. My design is of the "barn door" type, and is inspired by these projects: Makezine: 6 DIY Star Trackers for Perfect Night Sky Photos

In my build I add positional feedback so that the tracker can correct its motion over time - allowing (in theory) for increased precision.

Hardware

Usually my projects don't have a complicated mechanical aspect, but this one sure did. It was a good opportunity to try out some of the new robotics-focused parts that SparkFun offers like gears, axles, hubs, bearings, motors and encoders.

Here are the SparkFun parts that I used:

SparkFun Logic Level Converter - Bi-Directional

SparkFun Logic Level Converter - Bi-Directional

BOB-12009
$3.50
122
SparkFun Qwiic Cable Kit

SparkFun Qwiic Cable Kit

KIT-15081
$8.95
22
SparkFun Qwiic Motor Driver

SparkFun Qwiic Motor Driver

ROB-15451
$19.50
3
Rotary Encoder - 1024 P/R (Quadrature)

Rotary Encoder - 1024 P/R (Quadrature)

COM-11102
$48.50
9
SparkFun RedBoard Artemis Nano

SparkFun RedBoard Artemis Nano

DEV-15443
$16.50
6

Standard Gearmotor - 20 RPM (3-12V)

ROB-12288
Retired

Set Screw Hub - 1/4" Bore

ROB-12488
2 Retired

Gear - Hub Mount (84T; 0.5" Bore)

ROB-12228
Retired

Gear - Pinion Gear (16T; 0.25" Bore)

ROB-12158
Retired

Two changes to this list are as follows:

  • added a level shifter breakout for better compatibility with the encoder
  • changed the gearmotor to a 20 RPM version to fix a math mistake I made early in planning

I chose the RedBoard Artemis Nano for its small footprint, great support for interrupts (for the encoder) and, admittedly, because I am fond of it. To drive the motor I decided to try out the Qwiic Motor Driver because it would be easy to hook up and get going.

I also needed a few miscellaneous pieces/parts from a hardware store:

  • three-foot section of 1/4" stainless steel threaded rod
  • one brass 1/4" nut
  • one 1/4" nylock nut
  • one 1/4" wing nut
  • two 1/4" ID washers
  • one 1/4" ID lock washer
  • approximately 3.5' maple 1x4
  • a standard 3" door hinge

Figuring out how exactly to mount all these parts so that the gears would mesh correctly was perhaps the most challenging and time-consuming part of the project. I ended up making some rough 3D models of the main components and assembling them using OnShape (a very cool web-based 3D modeling application). Here are the public design files:

Build

I tried to dust off some old carpentry/fabrication skills and more or less discovered that dust is all they were to begin with. That being said here was my general process:

To build barn doors:

  1. Cut two 18" sections of maple 1x4 stock to serve as the barn doors.
  2. Within one section, mark a center line and a perpendicular hinge line about 1" from the end.
  3. Measure 14" from intersection and mark as center for the threaded rod.
  4. Use spray adhesive to locate top template over the threaded rod hole center.
  5. Drill small (1/8") holes where the pinion gear axles would go with a drill press (you can use a hand drill but make sure it is straight).
  6. Using those two holes, you can locate and adhere the bottom template.
  7. Use a router to route out the top template (pay attention to the correct depth [0.312"] and ignore the center hole).
  8. Flip over and drill the axle holes for the encoder/motor all the way through (5/16" or 3/8" drill bits work here).
  9. Working from the smallest shapes to the largest shapes, mill out the two levels for both the motor and encoder holes. Do the smaller ones first, because the template is destroyed in the process - pay attention to using the correct depth.

To build the drive mechanism:

  1. Use whatever means you can to affix the brass nut to the aluminum hub so that the hub can be screwed into the large drive gear (this one is hard, I used JB Weld, but broaching a hexagonal hole would be ideal).

To make the drive rod:

  1. Use a string or other method to trace out about 60 degrees worth of a 14" radius arc.
  2. With hands at either end of the threaded rod, use a pure twisting motion to bend it to match the 14" arc (the center will likely be the best section).
  3. Identify your best section and cut it out - the more you have, the longer you will be able to run the star tracker at a time.

Electronics hookup:

  1. Solder wires to the motor terminals.
  2. Connect motor wires into terminals A1 and A2 of the Qwiic Motor Driver.
  3. Connect your 8V to 11V DC power supply to the VIN terminals of the Motor Driver.
  4. Connect the Qwiic Motor Driver to the RedBoard Artemis Nano using a Qwiic Cable.
  5. Connect the encoder's brown wire to the same voltage supply as your motor.
  6. Connect the encoder's blue wire to GND on the Artemis Nano.
  7. Use your level shifting solution to connect the encoder's black and white wires to the Artemis on any pins you like (mosfet level shifters are recommended - I used voltage dividers because I was caught off guard and needed to whip something up fast. If you do this beware that the encoder has a 2k output impedance. I wound up using 2M and 1M resistors in my dividers).
  8. Power the Artemis Nano with a USB cable - or provide some other 5V source to VIN on the dev board.

final product
A completed (but far from finished) star tracker

Software

Though currently a work-in-progress, I plan to continue updating this project on GitHub: StarTracker.

Star trackers of this style don't necessarily even need software - a simple voltage regulator to adjust the motor's speed is often enough. In this case, however, I wanted to have a little fun and aim for high precision/reliability. For me that meant adding a feedback loop.

Earth's rotational rate is very stable (over the periods of time used to expose film for astrophotography), so you might wonder whether a control system is really necessary. In an idealized case you could set a motor off to do its own thing and it would also run at a constant rate. Any mismatch between the rate of the motor and the Earth's spin would be a constant error and stack up over time predictably. In fact, if you could get that difference to be small enough, then one could effectively hide it with other techniques (such as image stacking).

Here's an example of what that might look like (exaggerated)

alt text

  • Red: the measured error in rotational rate over time
  • Blue: the overall positional error that has accumulated over time - you would observe this in an image as trails beginning to form behind the stars.

What happens when dust/dirt clogs up the system? When the battery voltage sags in cold weather? When a heavy camera/lens combination strains the drive system? In those cases there may be error that changes over time and is much harder to predict and account for. Covering these scenarios is what an active feedback loop does very well.

Here's the same plot after adding proportional (P) feedback

alt text

This time, as the overall position error increases, a proportional "restoring force" is applied to bring it back to zero (in practice this means changing the speed at which the motor is set to run). You can see that the error now oscillates around zero rather than growing infinitely. This is good, but we want the error to settle down to zero - that's where derivative feedback comes into play.

And again after adding basic derivative (D) feedback

alt text

Finally, the error is controlled to zero. This is done by adding a "force" that counteracts motion toward the target.

Conclusion

Overall this was a fun way to combine my interests in astrophotography and control systems. The role of the latter in this project deserves a much more in-depth and precise examination, but it had to start somewhere! Hopefully this rig will be out there tracking stars very soon.

alt text


Comments 11 comments

  • Member #134773 / about 5 years ago / 1

    I'd like to share a possibly relevant idea. About 20 years ago a friend was tinkering with a microprocessor control for a telescope, and needed to communicate certain info to the user (typically a very simple message that could be represesnted by a single letter). Clearly, an LCD or LED readout was not appropriate, as it would affect "dark vision". He was thinking about a buzzer with a series of "long"/"short" buzzes for each possible message. I suggested to him that he make the "long"/"short" sequences standared Morse code for appropriate letters -- if you already know Morse code, "short-long-short" is easily identified as "R", and since he only had a handfull, if you didn't already know Morse code you could quickly learn to recognize it (in the dark) as the controller's signal for, say, "Right".

  • egrav / about 5 years ago / 1

    I'm also using a stepper with an Arduino 2560, and a ramps board with a TMC2130 stepper driver. The ramps board plugs into the mega like a shield, so everything connects together solidly. However, I'm running it on my telescope, with an EQ-2 mount. All that I need to provide is a steady pulse stream.

    I was looking at your code to see how the encoder was going to be used. I noticed in the comments that you were using 86,400 seconds as the length of a day. While true, this number doesn't account for the Earth revolving around the sun as well. This means that the earth turns an additional 360 degrees in ~365 days, nearly one degree per day. Therefore, sidereal time needs to be used to correlate the speed of the stars relative to the earth. A sidereal day equals 86164.0905 seconds per day, not 86,400. Here's a link that explains it way better than I can. https://earthsky.org/astronomy-essentials/what-is-sidereal-time

    • Liquid Soulder / about 5 years ago / 1

      Aha! Yes, sidereal time. I have some major plans to keep refining this project and that will be one of the improvements. Thanks for mentioning it! (I'll even go make an issue on GitHub to help me remember)

  • philfromseattle / about 5 years ago / 1

    Looks like a fun project. I'd like to point out that using a stepper motor with the appropriate gearing is a lot easier than an encoder and just as accurate without a lot of trial and error. It also costs less. I used an Arduino Nano, a little reprap style step stick (TMC2208 for super smooth stepping) and a custom PCB to tie it all together.

    The biggest hurdle I had was finding a way to gear the curved threaded rod. Using 3D Printer belts and gears turned out to be easy. I was able to press-fit a bearing onto a timing belt pulley that I tapped for my curved rod. In the end, it turned out pretty good.

    By the way, you will need a sight to be able to align the tracker with Polaris. This took far more head scratching than the gearing problem. I wound up CNCing a mount for a standard telescope spotting scope. Far more accurate than the straw method once properly aligned.

    • Liquid Soulder / about 5 years ago / 1

      Thanks Phil - I considered using a stepper motor but chose the gearmotor / encoder for a few different reasons: 1. Mainly was interested in using a high resolution encoder since I haven't before, and so that I could potentially apply it to robotics applications in the future 2. Even with microstepping and large gear reductions I was slightly disturbed about the idea of discrete steps shaking the assembly. These are probably totally unfounded fears but hey, they influenced my decision.

      I'm hoping to get one of the nice polar scopes that has an etched reticle to account for Polaris' misalignment with the true axis. I'd also like to use a better hinge with less slop, so at the same time maybe I can find a way to make the scope and hinge axis truly coaxial.

      Your solution for the rod sounds interesting. Do you have pictures anywhere that you could share?

  • Dave Mueller / about 5 years ago / 1

    Check out the double barn door tracker by Dave Trott. Mechanically a little more complicated but it is more accurate (or is it precise?).

    • Liquid Soulder / about 5 years ago / 1

      That is really neat, thanks for sharing! (Here's Dave Trott's Double Barn Door video) In theory this barn door solves tangent error completely by using the circular bend in the threaded rod. When it comes to actually bending the metal reality sets in and I'm not sure how significant those bending errors will be in the overall accuracy.

  • Member #134773 / about 5 years ago / 1

    I'm looking forward to seeing a picture or two of the completed tracker...

    • Liquid Soulder / about 5 years ago / 1

      Great point! Somehow this slipped past me. I just added a photo after the HW build instructions. I will definitely be giving it another go at some point - it turned out to be quite challenging to align those gears by hand.

      • Member #134773 / about 5 years ago / 1

        Thanks!

        One other minor point: what forms the hinge between the two doors? From the picture it looks like maybe some electrical tape, but I'm not sure. (I'm a tad bit surprised that a hinge isn't included in the stuff from the hardware store.)

        • Liquid Soulder / about 5 years ago / 1

          Bingo! It's a simple 3" door hinge. I'll update the article. Thanks for catching that!

Related Posts

Makers You Should Know

Recent Posts

Tags


All Tags