Accelerometer double integration

So I have a BMI088 IMU and I am using that to get the altitude of a thrust vectoring rocket. During ground testing, the IMU altitude data lined up very well with the Kalman filtered barometer data (MS5607) over short periods of time (1-5 seconds). I know accelerometer double integration is a terrible idea with mems sensors but since I only need accurate altitude for about 5 seconds maximum, and since a few others have been successful in that regard, I think it is ok here.

How I do it: Basically I first just take the z-axis acceleration, take an average of 10000 values, and subtract it from the z-accel. Then, I rotate the z-accel using a quaternion library. I don't think this was ever accurate as the z-accel did change a bit when the flight computer orientation changed. Next, I used a Reimann sum for integration as my loop time is non static 100hz so I thought since the dt should be so small, the integration method wouldn't really matter. code:


    void accel_position(double dt) {

  // Find the Z-axis acceleration in the global reference frame
  global_acc_z = -aZ;
  
  // Remove gravity component from global Z-axis acceleration
  global_acc_z -= global_acc_z_bias;

  // During sensor calibration, set the bias so we can later remove the gravity component
  if (state == 0) {
    global_acc_z_bias = global_acc_z;
  }

  // When pad idle, keep first measurements ready but do not integrate yet!
  if (state == 2) {
    //global_acc_z_bias = global_acc_z;
    vel_z = global_acc_z * dt;
    pos_z = vel_z * dt;
  }

  // Ok, start integrating, we have liftoff!
  if (state > 2) {
    vel_z += global_acc_z * dt;
    pos_z += vel_z * dt;
  }
}

Actual TVC flight data(rocket flies using 2 Estes e12 motors, the second one fires once the first is done burning and is ejected from the vehicle. You can actually see both of the thrust curves in the acceleration data!):
APKBEB
The barometer got about 35 meters AGL and the accelerometer got about 20 meters AGL. I know that the barometer is accurate because when the rocket falls in a tree, there is an acceleration spike and the barometer altitude is about 2 meters constant while the accelerometer altitude is at -20 meters. This didn't show up in the ground tests. And people with the same IMU have gotten much better results for TVC rockets and the data lines much better with the same exact IMU.

What could be a possible culprit? Could it be the global acceleration calculation? Why didn't it show up during testing?

Anyone is going to need to see a complete sketch that demonstrates the problem.

If you have a barometer that works, why are trying to do what is, as you yourself have found, just not going to work well in practice?

Even if someone somewhere says it works. I don't know what differences there might be between your testing and the actual run with the rocket for real.

a7

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.