Close

Accelerometer and Perspective Projection work

A project log for explorad

Work in progress: The explorad combines a microcontroller, a display, and star charts in a head-up display for astronomical telescopes.

ChristophChristoph 05/21/2014 at 19:150 Comments

I can now read the accelerometer and convert the readings to pitch and roll. In terms of horizontal spherical coordinates, pitch is equivalent to altitude. Roll is important as well, but in another context: When the explorad is attached to a telescope, we don't know if it is tilted around its viewing axis. Measuring roll can thus be used to rotate the displayed objects and the target marker around the viewing axis to compensate roll.

I have not yet built the hardware for measuring the device's azimuth, so I simply attached a potentiometer to my Teensy. When I turn it, the mount driver turns the reading into a fictional azimuth for testing.

The projection of horizontal (azimuth, altitude) to cartesian (x,y,z) to display coordinates (x, y) is more or less straight forward. I use the Eigen library for matrix calculations, which might seem to be overkill, but it's convenient and I can do linear regression with it, which I might need later.

Here's a picture with the target being south (azimuth = 0) at the horizon (altitude = 0), with the device pointing slightly to the west (azimuth = 2.6°), below the horizon (-0.9°) and tilted counter-clockwise by 7.2°:

The X mark shows where the target is and you can also see the three standard telrad circles with 0.5°, 2° and 4° diameter. The small square with circles in it at the upper left corner is a button I can use to toggle visibility of the telrad circles. The "dummy azimuth" potentiometer is right beside the buttons.

Next on the list: Add a GPS and suitable widgets for GPS/manual location and time input.

Discussions