-1

I used EKF to observe the quaternion and extract the roll, pitch and yaw angles. The used sensors are Gyro sensor and acceleration sensor.

The roll and pitch angle looks like proper but the yaw angle is not proper.

In this case , I can't get the correct yaw angle? If I add a magnetic sensor and estimate the state using EKF, could I get the proper yaw angle?

N. Staub
  • 1,412
  • 8
  • 21
kkj
  • 1
  • 2

1 Answers1

0

Yes, you need to add another sensor such as magnometer. The accelerometer tells you which direction is 'down'. Whether you are facing north, east, south, or west 'down' is still the same so the accelerometer alone can't tell you that information but a magnometer can.

One thing to be careful of is the magnometer will also provide some information about roll/pitch but usually you don't want this. You can either use the magnometer values outside the EKF to estimate yaw, which is fine if you are close to zero roll/pitch, or you can make sure the magnometer weights are smaller than the accelerometer weights.

ryan0270
  • 2,804
  • 11
  • 9
  • But I have one question . I only used quortanion:q1,q2,q3,q4 and the state space equation is a differential equation of quortanion. The output value y is DCM * gravity. In this case, I feel that the yaw value is not correction in EKF .The meaning of calculated yaw angle is same as gyro_yaw = gyro_yaw * dt due to a differential equation of quortanion. But the output value of yaw in EKF is not equal to Integral of gyro_yaw. – kkj Aug 29 '17 at 20:49
  • and compare output_from_EKF.xlsx and output_from_jyr.xlsx by drawing the plot in relation to yaw angle.I encountered same problem in this site. – kkj Aug 29 '17 at 20:55
  • Sorry, I don't understand your comments. If your only sensors are gyro and accel, the plane perpendicular to the acceleration vector is not observable. If you had a perfect gyro you could integrate it to get yaw, but all real gyros have bias errors so the yaw estimate will quickly drift. – ryan0270 Aug 30 '17 at 02:04