# After computing orthogoanl X, Y and Z matrix, a Taylor's expansion is used in 'Direction Cosine Matrix IMU: Theory'.

Scaling X, Y and Z using a Taylor's expansion,

[In the paper]

X_norm =  0.5 (3 - dot(X_orth, X_orth)) * X_orth

Y_norm =  0.5 (3 - dot(Y_orth, Y_orth)) * Y_orth

Z_norm =  0.5 (3 - dot(Z_orth, Z_orth)) * Z_orth

> dot(X,X) = dot product

But when I look at the C programming code.

[C programming code]

/* U scaling */
VectorDotProduct(&rmat, &rmat, &f_buff);
f_buff = 1./sqrt(f_buff);
for (i=0;i<3;i++) rmat[i] = rmat[i]*f_buff;

/* V scaling */
VectorDotProduct(&rmat, &rmat, &f_buff);
f_buff = 1./sqrt(f_buff);
for (i=0;i<3;i++) rmat[3+i] = rmat[3+i]*f_buff;

/* W scaling */
VectorDotProduct(&rmat, &rmat, &f_buff);
f_buff = 1./sqrt(f_buff);
for (i=0;i<3;i++) rmat[6+i] = rmat[6+i]*f_buff;

1) This way is to divide each element of each row instead of Taylor's expansion. But I am not sure how to represent mathmatically.Could anyone help me how to work and represent it?

2) '&' looks like pointers. If this symbol is the pointer in C programming, please tell me how to work.

3) Please could anyone tell me why this use 1/sqrt(x*x) instead of Taylor's expansion?

Thank you very much

Views: 733

### Replies to This Discussion

The taylor expansion is just a first term expansion of the square root function around a nominal value of 1, and is used in place of the square root function to reduce the processing time required by the function.

Other than processing time there is no reason to use the taylor series expansion - it is only an approximation.

I really thank you for your tips. So the taylor series expansion is not used in the system.

## Top Discussions

1 ### Arduplane 3.9 flyaway with bad compass

2 ### How to enable ArduIMU 3 magnetometer?

3 ### RFD900 Telemetry will not connect in Mission Planner. All settings tried.

4 ### Long distance LiPo

5 ### Connection problems 3dr radio look alike: Andropilot Users Group

6 ### Short (34 ohms) between power rails?

7 ### What is the difference between a consumer drone and an industrial drone?

8 9 ### Cheap yet very good Quadcopters

10 ## Groups

45 members

1472 members

282 members

470 members

• ### 3D Models

57 members

A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here