I'm working on a PID-controlled barn door tracker mount for astrophotography in an isosceles configuration: Isosceles configuration barn door tracker

For those not familiar, the purpose of the barn door tracker is to compensate for the rotation of the earth during astrophotography. The axis of rotation of the tracker is aligned with Polaris, and the upper arm of the tracker rotates about that axis once in a sidereal day (approximately once per 24 hours). So the movement is very slow, but not unnoticeable.

A lot of people use a curved bolt configuration to make it so you can simply set the motor at a constant rate of rotation and get a constant angular rate, but I don't like the inability to address sources of error with that configuration. Instead, I would like to use PID control.

My motivation is both for a fun project, but also to create something that is more accurate than a curved-bolt configuration and cheaper than entry-level equatorial mounts. Ignoring the cost of microcontrollers, I'm aiming to have the entire setup cost less than $120. If I can't make it for that cheap, then I might as well get a professionally-made mount.

I've been looking at different methods of getting angular feedback, and I'm most interested in two: encoder and accelerometer. An encoder would be fairly easy to implement in code and resolution could be influenced by hardware. However, a quadrature encoder would use up almost half of my budget, and I'm skeptical of using just an incremental encoder, in case my PID tuning is off. Not to mention I would have to implement an additional way to home the tracker.

After playing around with an app that lets me see the sensor outputs on my smartphone, I wondered whether an accelerometer might be a cheap alternative. There are plenty of sensors that are USB or Arduino-compatible out of the box. My biggest concern, however, is that of accuracy. The angular change is only about half a degree per minute, but in the isosceles configuration, the rate of the motor must change accurately to maintain a constant angular speed. I need something that will be able to capture that slow of a change accurately.

I'm not a controls or robotics guy, so for all I know I'm completely missing some other component that might fit the bill. Any thoughts on the advantages or disadvantages of the sensors I've mentioned? Or places I might look for more affordable types of sensors?

  • $\begingroup$ The cheapest sensor that can measure angular displacement is the potentiometer. The plastic style has the best resolution but you will have to have some electronics experience to use the pot in a circuit (and a mechanical configuration) that is going to control a servomotor. I'm sure there are people already doing this kind of hack, just keep Google-ing until you find one you like. It would be a nice high school science project ! $\endgroup$ Nov 7 '18 at 22:18
  • $\begingroup$ I'm not sure what a controller loop would buy you here. A stepper motor and a reduction gear could easily give more accurate control of rotation than you could measure (i.e. one part in 10^4 or better). Since you know the geometry of the mechanism, you could calculate the variable speed required and use the Arduino to generate the motor control signals. $\endgroup$
    – alephzero
    Nov 8 '18 at 14:12
  • $\begingroup$ @alephzero That's precisely what I've seen one other person do. My thinking in using the controller loop was to allow the user to start the tracking cycle from any "non-home" position, for example, if an adjustment needed to be made on the camera it might be easier to start at a non-zero angle. If the system always can tell where it is, then there's no need to start it perfectly from home position. Then there's also the risk of the stepper motor skipping steps and not being conscious of that happening. It's been a while since I've used steppers though so I could be off-base in that concern. $\endgroup$ Nov 9 '18 at 15:38

Since this application doesn't require continuous rotation, rather, it shuttles between limits, you can use a rotary potentiometer to provide angular feedback. Most 'standard' Pots have 270 degrees of rotation, so you would need to add some gearing - I'd recommend pulleys for this since the forces involved are very low, and you don't want backlash. Then simply set up the Pot as a divider, and use the analogue read pins to measure the voltage, and hence the rotation.

Have a watch of this video for an example of this theory being implemented: https://www.youtube.com/watch?v=3pYWLF8qw-g

  • $\begingroup$ The tracker will need 18 hours to use the entire 270 deg span. If the pot where to be sampled once per second (which is rather slow for a PID controller), that would mean you need a resolution of at least 64.800 distinct steps, i.e. you need at least a true 16 bit A/D and a pot that has less than 15 ppm total error (non linearity + noise). Both will cost a fair amount of money. $\endgroup$ Nov 10 '20 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.