Finding altitude and azimuth with an accelerometer and magnetometer











up vote
0
down vote

favorite












I posted this in the astronomy stack exchange forum, but considering that it is a very math intensive question I figured there could also be people on here that could help.



For a project with my astronomy professor, we are hooking up an array of 4 smaller telescopes to observe objects in space together.



To do this, we wanted to put an accelerometer and magnetometer on each telescope and have it read data from the gravitational pull on the accelerometer and the pull from the north magnetic pole on the magnetometer.



The accelerometer would measure the altitude, or the absolute height of measure point where accelerometer is at on the telescope. This would be converted to the angle of the telescope from its initial plane (when it makes a 90 degree angle with its stand and Cartesian z is zero).



The magnetometer would measure the pull of the of the magnetic north pole, and be able to give the azimuth angle, or the angle (from 0-360) that the telescope is pointing away from the magnetic north pole (0 degrees in the x direction would be pointing at the magnetic north pole).



Both readings are recorded in microteslas.



My professor said he was able to solve the altitude equation, but doesn't have time for the azimuth. He suggested treating the telescope itself as a 3D vector, normalizing it, and the projecting it down onto a flat plane, i.e. where it makes a 90 degree angle with the stand.



Would I use a rotational matrix for this? And should I treat the magnetometer and accelerometer vectors as two separate matrix vectors and use one to solve the other? What would the end equation look like?










share|cite|improve this question






















  • Do accelerometers measure gravitational attraction ? I don't know anything about it but I had assumed they measure acceleration.
    – Simon
    May 26 '16 at 20:38










  • Gravitational attraction is measured in acceleration. Earth's at sea level is roughly 9.8m/s/s, which is an acceleration. So yeah
    – Chris
    May 26 '16 at 21:08










  • Thanks - that's very interesting. I had the wrong idea. I had imagined they would only detect movement.
    – Simon
    May 26 '16 at 21:09












  • Accelerometers only measure proper acceleration which does not include gravity. When you think of an accelerometer, imagine two rocks connected by a spring, [x]~~[x], with some way to measure the deflection of the spring connecting them. In free fall, the rocks move in perfect tandem, so the spring deflection is zero. Place one rock on a table (with the other above) and the spring compresses. That compression will be due to the acceleration caused by the normal force from the table.
    – jnez71
    Mar 20 at 2:14

















up vote
0
down vote

favorite












I posted this in the astronomy stack exchange forum, but considering that it is a very math intensive question I figured there could also be people on here that could help.



For a project with my astronomy professor, we are hooking up an array of 4 smaller telescopes to observe objects in space together.



To do this, we wanted to put an accelerometer and magnetometer on each telescope and have it read data from the gravitational pull on the accelerometer and the pull from the north magnetic pole on the magnetometer.



The accelerometer would measure the altitude, or the absolute height of measure point where accelerometer is at on the telescope. This would be converted to the angle of the telescope from its initial plane (when it makes a 90 degree angle with its stand and Cartesian z is zero).



The magnetometer would measure the pull of the of the magnetic north pole, and be able to give the azimuth angle, or the angle (from 0-360) that the telescope is pointing away from the magnetic north pole (0 degrees in the x direction would be pointing at the magnetic north pole).



Both readings are recorded in microteslas.



My professor said he was able to solve the altitude equation, but doesn't have time for the azimuth. He suggested treating the telescope itself as a 3D vector, normalizing it, and the projecting it down onto a flat plane, i.e. where it makes a 90 degree angle with the stand.



Would I use a rotational matrix for this? And should I treat the magnetometer and accelerometer vectors as two separate matrix vectors and use one to solve the other? What would the end equation look like?










share|cite|improve this question






















  • Do accelerometers measure gravitational attraction ? I don't know anything about it but I had assumed they measure acceleration.
    – Simon
    May 26 '16 at 20:38










  • Gravitational attraction is measured in acceleration. Earth's at sea level is roughly 9.8m/s/s, which is an acceleration. So yeah
    – Chris
    May 26 '16 at 21:08










  • Thanks - that's very interesting. I had the wrong idea. I had imagined they would only detect movement.
    – Simon
    May 26 '16 at 21:09












  • Accelerometers only measure proper acceleration which does not include gravity. When you think of an accelerometer, imagine two rocks connected by a spring, [x]~~[x], with some way to measure the deflection of the spring connecting them. In free fall, the rocks move in perfect tandem, so the spring deflection is zero. Place one rock on a table (with the other above) and the spring compresses. That compression will be due to the acceleration caused by the normal force from the table.
    – jnez71
    Mar 20 at 2:14















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I posted this in the astronomy stack exchange forum, but considering that it is a very math intensive question I figured there could also be people on here that could help.



For a project with my astronomy professor, we are hooking up an array of 4 smaller telescopes to observe objects in space together.



To do this, we wanted to put an accelerometer and magnetometer on each telescope and have it read data from the gravitational pull on the accelerometer and the pull from the north magnetic pole on the magnetometer.



The accelerometer would measure the altitude, or the absolute height of measure point where accelerometer is at on the telescope. This would be converted to the angle of the telescope from its initial plane (when it makes a 90 degree angle with its stand and Cartesian z is zero).



The magnetometer would measure the pull of the of the magnetic north pole, and be able to give the azimuth angle, or the angle (from 0-360) that the telescope is pointing away from the magnetic north pole (0 degrees in the x direction would be pointing at the magnetic north pole).



Both readings are recorded in microteslas.



My professor said he was able to solve the altitude equation, but doesn't have time for the azimuth. He suggested treating the telescope itself as a 3D vector, normalizing it, and the projecting it down onto a flat plane, i.e. where it makes a 90 degree angle with the stand.



Would I use a rotational matrix for this? And should I treat the magnetometer and accelerometer vectors as two separate matrix vectors and use one to solve the other? What would the end equation look like?










share|cite|improve this question













I posted this in the astronomy stack exchange forum, but considering that it is a very math intensive question I figured there could also be people on here that could help.



For a project with my astronomy professor, we are hooking up an array of 4 smaller telescopes to observe objects in space together.



To do this, we wanted to put an accelerometer and magnetometer on each telescope and have it read data from the gravitational pull on the accelerometer and the pull from the north magnetic pole on the magnetometer.



The accelerometer would measure the altitude, or the absolute height of measure point where accelerometer is at on the telescope. This would be converted to the angle of the telescope from its initial plane (when it makes a 90 degree angle with its stand and Cartesian z is zero).



The magnetometer would measure the pull of the of the magnetic north pole, and be able to give the azimuth angle, or the angle (from 0-360) that the telescope is pointing away from the magnetic north pole (0 degrees in the x direction would be pointing at the magnetic north pole).



Both readings are recorded in microteslas.



My professor said he was able to solve the altitude equation, but doesn't have time for the azimuth. He suggested treating the telescope itself as a 3D vector, normalizing it, and the projecting it down onto a flat plane, i.e. where it makes a 90 degree angle with the stand.



Would I use a rotational matrix for this? And should I treat the magnetometer and accelerometer vectors as two separate matrix vectors and use one to solve the other? What would the end equation look like?







linear-algebra trigonometry vector-spaces mathematical-astronomy






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked May 26 '16 at 19:38









Chris

11




11












  • Do accelerometers measure gravitational attraction ? I don't know anything about it but I had assumed they measure acceleration.
    – Simon
    May 26 '16 at 20:38










  • Gravitational attraction is measured in acceleration. Earth's at sea level is roughly 9.8m/s/s, which is an acceleration. So yeah
    – Chris
    May 26 '16 at 21:08










  • Thanks - that's very interesting. I had the wrong idea. I had imagined they would only detect movement.
    – Simon
    May 26 '16 at 21:09












  • Accelerometers only measure proper acceleration which does not include gravity. When you think of an accelerometer, imagine two rocks connected by a spring, [x]~~[x], with some way to measure the deflection of the spring connecting them. In free fall, the rocks move in perfect tandem, so the spring deflection is zero. Place one rock on a table (with the other above) and the spring compresses. That compression will be due to the acceleration caused by the normal force from the table.
    – jnez71
    Mar 20 at 2:14




















  • Do accelerometers measure gravitational attraction ? I don't know anything about it but I had assumed they measure acceleration.
    – Simon
    May 26 '16 at 20:38










  • Gravitational attraction is measured in acceleration. Earth's at sea level is roughly 9.8m/s/s, which is an acceleration. So yeah
    – Chris
    May 26 '16 at 21:08










  • Thanks - that's very interesting. I had the wrong idea. I had imagined they would only detect movement.
    – Simon
    May 26 '16 at 21:09












  • Accelerometers only measure proper acceleration which does not include gravity. When you think of an accelerometer, imagine two rocks connected by a spring, [x]~~[x], with some way to measure the deflection of the spring connecting them. In free fall, the rocks move in perfect tandem, so the spring deflection is zero. Place one rock on a table (with the other above) and the spring compresses. That compression will be due to the acceleration caused by the normal force from the table.
    – jnez71
    Mar 20 at 2:14


















Do accelerometers measure gravitational attraction ? I don't know anything about it but I had assumed they measure acceleration.
– Simon
May 26 '16 at 20:38




Do accelerometers measure gravitational attraction ? I don't know anything about it but I had assumed they measure acceleration.
– Simon
May 26 '16 at 20:38












Gravitational attraction is measured in acceleration. Earth's at sea level is roughly 9.8m/s/s, which is an acceleration. So yeah
– Chris
May 26 '16 at 21:08




Gravitational attraction is measured in acceleration. Earth's at sea level is roughly 9.8m/s/s, which is an acceleration. So yeah
– Chris
May 26 '16 at 21:08












Thanks - that's very interesting. I had the wrong idea. I had imagined they would only detect movement.
– Simon
May 26 '16 at 21:09






Thanks - that's very interesting. I had the wrong idea. I had imagined they would only detect movement.
– Simon
May 26 '16 at 21:09














Accelerometers only measure proper acceleration which does not include gravity. When you think of an accelerometer, imagine two rocks connected by a spring, [x]~~[x], with some way to measure the deflection of the spring connecting them. In free fall, the rocks move in perfect tandem, so the spring deflection is zero. Place one rock on a table (with the other above) and the spring compresses. That compression will be due to the acceleration caused by the normal force from the table.
– jnez71
Mar 20 at 2:14






Accelerometers only measure proper acceleration which does not include gravity. When you think of an accelerometer, imagine two rocks connected by a spring, [x]~~[x], with some way to measure the deflection of the spring connecting them. In free fall, the rocks move in perfect tandem, so the spring deflection is zero. Place one rock on a table (with the other above) and the spring compresses. That compression will be due to the acceleration caused by the normal force from the table.
– jnez71
Mar 20 at 2:14












1 Answer
1






active

oldest

votes

















up vote
0
down vote













You can use a Rotation Matrix or alternatively by Vector Maths.

I'm assuming that the Accel and the Magnetometer are aligned in the same orientation, i.e. the X, Y and Z axis are pointing in the same directions, also, that the Z Axis is the Axis that you want to use for the Azimuth angle.



If you take your Vectors of G (Accel), H (Magnetometer) and Z (Axis of Azimuth Calc) values: $$ G = begin{bmatrix} Gx & Gy & Gz end{bmatrix} \ H = begin{bmatrix} Hx & Hy & Hz end{bmatrix} \ Z = begin{bmatrix} 0 & 0 & 1 end{bmatrix}
$$



You then need to Calculate:



$$ B = G times Z \
A = G times H $$



The Azimuth Angle $ theta $ is then:



$$ cos theta = frac{(A bullet B)}{lvert A rvert bullet lvert B rvert} $$






share|cite|improve this answer





















    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1801253%2ffinding-altitude-and-azimuth-with-an-accelerometer-and-magnetometer%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    You can use a Rotation Matrix or alternatively by Vector Maths.

    I'm assuming that the Accel and the Magnetometer are aligned in the same orientation, i.e. the X, Y and Z axis are pointing in the same directions, also, that the Z Axis is the Axis that you want to use for the Azimuth angle.



    If you take your Vectors of G (Accel), H (Magnetometer) and Z (Axis of Azimuth Calc) values: $$ G = begin{bmatrix} Gx & Gy & Gz end{bmatrix} \ H = begin{bmatrix} Hx & Hy & Hz end{bmatrix} \ Z = begin{bmatrix} 0 & 0 & 1 end{bmatrix}
    $$



    You then need to Calculate:



    $$ B = G times Z \
    A = G times H $$



    The Azimuth Angle $ theta $ is then:



    $$ cos theta = frac{(A bullet B)}{lvert A rvert bullet lvert B rvert} $$






    share|cite|improve this answer

























      up vote
      0
      down vote













      You can use a Rotation Matrix or alternatively by Vector Maths.

      I'm assuming that the Accel and the Magnetometer are aligned in the same orientation, i.e. the X, Y and Z axis are pointing in the same directions, also, that the Z Axis is the Axis that you want to use for the Azimuth angle.



      If you take your Vectors of G (Accel), H (Magnetometer) and Z (Axis of Azimuth Calc) values: $$ G = begin{bmatrix} Gx & Gy & Gz end{bmatrix} \ H = begin{bmatrix} Hx & Hy & Hz end{bmatrix} \ Z = begin{bmatrix} 0 & 0 & 1 end{bmatrix}
      $$



      You then need to Calculate:



      $$ B = G times Z \
      A = G times H $$



      The Azimuth Angle $ theta $ is then:



      $$ cos theta = frac{(A bullet B)}{lvert A rvert bullet lvert B rvert} $$






      share|cite|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        You can use a Rotation Matrix or alternatively by Vector Maths.

        I'm assuming that the Accel and the Magnetometer are aligned in the same orientation, i.e. the X, Y and Z axis are pointing in the same directions, also, that the Z Axis is the Axis that you want to use for the Azimuth angle.



        If you take your Vectors of G (Accel), H (Magnetometer) and Z (Axis of Azimuth Calc) values: $$ G = begin{bmatrix} Gx & Gy & Gz end{bmatrix} \ H = begin{bmatrix} Hx & Hy & Hz end{bmatrix} \ Z = begin{bmatrix} 0 & 0 & 1 end{bmatrix}
        $$



        You then need to Calculate:



        $$ B = G times Z \
        A = G times H $$



        The Azimuth Angle $ theta $ is then:



        $$ cos theta = frac{(A bullet B)}{lvert A rvert bullet lvert B rvert} $$






        share|cite|improve this answer












        You can use a Rotation Matrix or alternatively by Vector Maths.

        I'm assuming that the Accel and the Magnetometer are aligned in the same orientation, i.e. the X, Y and Z axis are pointing in the same directions, also, that the Z Axis is the Axis that you want to use for the Azimuth angle.



        If you take your Vectors of G (Accel), H (Magnetometer) and Z (Axis of Azimuth Calc) values: $$ G = begin{bmatrix} Gx & Gy & Gz end{bmatrix} \ H = begin{bmatrix} Hx & Hy & Hz end{bmatrix} \ Z = begin{bmatrix} 0 & 0 & 1 end{bmatrix}
        $$



        You then need to Calculate:



        $$ B = G times Z \
        A = G times H $$



        The Azimuth Angle $ theta $ is then:



        $$ cos theta = frac{(A bullet B)}{lvert A rvert bullet lvert B rvert} $$







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Nov 3 '16 at 11:13









        Mike

        186314




        186314






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1801253%2ffinding-altitude-and-azimuth-with-an-accelerometer-and-magnetometer%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Ellipse (mathématiques)

            Quarter-circle Tiles

            Mont Emei