Getting an accurate yaw angle from the MinIMU-9 depends strongly on having the magnetometer calibrated well; have you obtained some calibration constants for your sensor to use in your code? Are you using it with an Arduino and running our example programs?
Please keep in mind as well that the magnetometer will measure magnetic north, which can be many degrees off from true, or geographic, north (magnetic declination).
Yes I have calibrated the magnetics but it is still wacky.
I would like to NOT use the magnetometer but set the Az/El to a known
position then go from there.
Do you think that the IMU would produce accuracy for precise positioning?
The magnetometer is important to provide a reference for the absolute yaw angle. Without it, the gyro’s measurement of the yaw will eventually drift, so I don’t expect it to work very well.
There are some other, more complicated calibration methods that might give you some better results, such as what David described in this post. I also suggest trying to keep it far from things in the environment that could distort the magnetic field around it (large metal objects, high current wires), and If you are mounting it near anything metal that moves together with the sensor (e.g. if the body of the telescope is metal), make sure you calibrate it while it is mounted in that setup.
Edit: Someone else here pointed out that I probably misunderstood what you were asking. If you’re asking about orienting the IMU to use a different axis to measure azimuth, that still would not work without the magnetometer or some other fixed yaw reference to keep it from drifting. (There is nothing unique about any of the axes in the IMU; each of the sensors give readings in 3 axes, and those measurements are used in different ways depending on how the board is actually oriented.)
If you have a handheld compass (one with a needle, or maybe even a compass app on a smartphone), you can easily use it to determine whether you can get an accurate magnetic heading where the IMU is mounted or if the surroundings are interfering with it too much. If you are getting outside interference, you can try to limit it by moving it away from walls or metal objects in the environment. If the IMU is mounted to something metal, you might also get better results by mounting it on a mast (some ground robots do this to minimize magnetic interference from their motors and circuitry). Can you take a picture of how you have the IMU mounted?
On the other hand, if you do get a reasonable heading from a handheld compass, then that suggests that your IMU magnetometer is not calibrated well. Just to make sure, have you run the “calibrate” Arduino example, pointed the IMU in as many different orientations as you can (it is not enough to just turn it in a circle), and then copied the min and max values into the constants defined in the AHRS code? What are the calibration values you obtained? If you try this process a few more times and it still doesn’t change your results, you might have to use a more complex calibration method like I mentioned before.
You might be able to use something else as a fixed yaw reference, but it would be up to you to figure out how to integrate that into the AHRS code.