Go Down

### Topic: Can We Read Yaw Axis Without Compass? (Read 1 time)previous topic - next topic

#### mamette

##### Apr 11, 2013, 05:47 pm
Hi, i want to read yaw axis for my project. So far, i do this by using compass (3 Axis magnetometer). But, it has a problem when i tilt it. I have tried many tilt compensation compass algorithm but still didn't solve the problem.

My Question is can we read yaw axis without compass? For example, use accelerometer or gyro?
Is there another method to read yaw axis?

thank you..

#### pylon

#1
##### Apr 11, 2013, 07:17 pm
You can measure the change with a gyrometer but if you need an absolute value the magnetometer is the way to go.

What problem do you have if you tilt it? What output do you expect? If you have a 3 axis magnetometer, you can calculate the facing direction even if the device is tilted. Post the code you used so far.

#### mamette

#2
##### Apr 12, 2013, 04:34 am
This is my code:

https://github.com/mamette/CompassCompensate/blob/master/main.ino

Quote
What problem do you have if you tilt it? What output do you expect? If you have a 3 axis magnetometer, you can calculate the facing direction even if the device is tilted

I want to make 3 axis gimbal, and the problem is on the yaw axis. SO far, i can calculate the heading degree, but when i tilt it, the value is change. I have tried tilt compensation compass algorithm from many reference, but still not works well. Are we must calibrate the magnetometer Max and Min value for each axis first? For Example like this:
Code: [Select]
`#define M_X_MIN -421#define M_Y_MIN -639#define M_Z_MIN -238#define M_X_MAX 424#define M_Y_MAX 295#define M_Z_MAX 472`

#### pylon

#3
##### Apr 12, 2013, 04:10 pm
Which sensor module are you using? The way the different values are transformed depends on the placement of the components on the PCB, so this fact is relevant.

What values do you get and what would have been the expected values?

#### mamette

#4
##### Apr 13, 2013, 09:12 am

Which sensor module are you using? The way the different values are transformed depends on the placement of the components on the PCB, so this fact is relevant.

What values do you get and what would have been the expected values?

i use this Board:
https://www.hobbyking.com/hobbyking/store/__27033__MultiWii_328P_Flight_Controller_w_FTDI_DSM2_Port.html

the value that i expected is when i tilt the board, the compass heading degree is not change, i have use tilt compensation algorithm for magnetometer, but still not works, the heading degree still change when i tilt the board..

#### pylon

#5
##### Apr 15, 2013, 06:49 pm
Quote
the value that i expected is when i tilt the board, the compass heading degree is not change, i have use tilt compensation algorithm for magnetometer, but still not works, the heading degree still change when i tilt the board..

How much does it change if you tilt it? a few degrees or more than 90 degrees? Can you give example output of such a session?

The components used are not placed all in the middle of the board so one must expect some drifting if your calculations are used.

Go Up

Please enter a valid email to subscribe