Cheap and accurate angle measurement for PID feedback control
I'm working on a PID-controlled barn door tracker mount for astrophotography in an isosceles configuration:
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. 229
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? 288