1

I have been trying to create the model of a drone for fun and when calculating the linear dynamics I need to find out the Z component of the thrust vector.

Basically, in 3D space the thrust vector is always perpendicular to my drone, hence its angle and therefore z component changes with the pitch and the roll of the drone. Pitch is the angle about the x axis and roll is the angle about the y axis with $ 0$ degrees being the vector pointing straight up.

I also know the total magnitude of the thrust vector, basically the total thrust generated by my drone. From there I can easily get the thrust vectors' components in the x and y directions by multiplying the vector's magnitude to, respectively, sin(roll) and sin(pitch).

What I have been doing until now is then using the magnitude to write that: $$M^2=X^2+Y^2+Z^2$$ with M being the magnitude and X, Y Z the components of the thrust vector. From this I rewrote,

$$Z=\sqrt{M^2-X^2-Y^2}$$

Again here: $$X=sin(roll)*M$$ and $$Y=sin(pitch)*M$$ with roll the angle about the y axis and pitch the angle about the X axis.

The problem is that this fails in a lot of cases as $M^2-X^2-Y^2$ becomes negative. I am sure I did something basic pretty wrong here but I cannot get my head around it, I would greatly appreciate your help if anyone knows what I am doing wrong.

Thank you!

elt93
  • 21

1 Answers1

1

Actually, I think I found a way to do it if this ever helps anyone: Instead of thinking about it the way presented above, I considered the fact that with no angles of rotation, the Z coordinate was equal to the magnitude of the thrust.

A positive pitch creates an angle between Z and the thrust vector (looking in the 2D ZY coordinate system), the z coordinate of this vector then becomes: $$ Z=M*cos(Pitch) $$

Another rotation in roll (now in the 2D ZX plane) will also lad the new Z coordinate to become:

$$ Z=M*cos(Roll) $$

So eventually, putting this together, we get: $$Z=M*cos(Pitch)*cos(Roll)$$

elt93
  • 21