That answer to that question is simple in theory.
You have 3 sets off axis:
First you have the XYZ axis in rest (IMU in rest, ideally aligned in the perfect directions and all measurements should be considered as "zero").
Second you have the levelled/callibrated axis, basically rest + standard offset for XYZ, to compensate between "zero" and the compass heading.
An offset should be constant and you could just summarize different offsets (one for levelling and one for callibration).
Therefore it makes little difference in theory wether you callibrate the levelled sensor or startt with (zero + level offset.=new_zero).
To simplify start with leveling+callibration and call that state you find at the end of the second step "zero + offset" XYZ-axis.
Third you have the "current" measured XYZ axis (or rather the current XYZ directions calculated from 3 DOF rotation, 3 DOF translation and 3 DOF magnetic direction).
From current -/- (zero + offset) you can calculate the roll and pitch. During my school days we called that basic mathematics. The concept is easy, writing it out is a lot of work (and a smart implementation saves a lot of work, meaning more wrtiting and less calculation for the CPU).
If the "zero + offset" XYZ axis creeps you can throw away your measurement.
And you should check if the IMU is bad or whatever else causes the deviation.
Otherwise you'd have to callibrate during the measurements.
I think sean pointed out the one of the 3 direction sensors is more susceptible to temperature, that's where things get rough. If nothing helps you could callibrate the IMU with temperature as a extra parameter. But that is something you'd rather avoid, since your calculation gets more complex. But the combination of an MPU925x and a BMP280 is a very logical one.
With temperature correction you hope to find:
current -/- ("zero + offset" + "temperature offset")
Again, easy in theory since the temperature offset is not constant.
You have 3 sets off axis:
First you have the XYZ axis in rest (IMU in rest, ideally aligned in the perfect directions and all measurements should be considered as "zero").
Second you have the levelled/callibrated axis, basically rest + standard offset for XYZ, to compensate between "zero" and the compass heading.
An offset should be constant and you could just summarize different offsets (one for levelling and one for callibration).
Therefore it makes little difference in theory wether you callibrate the levelled sensor or startt with (zero + level offset.=new_zero).
To simplify start with leveling+callibration and call that state you find at the end of the second step "zero + offset" XYZ-axis.
Third you have the "current" measured XYZ axis (or rather the current XYZ directions calculated from 3 DOF rotation, 3 DOF translation and 3 DOF magnetic direction).
From current -/- (zero + offset) you can calculate the roll and pitch. During my school days we called that basic mathematics. The concept is easy, writing it out is a lot of work (and a smart implementation saves a lot of work, meaning more wrtiting and less calculation for the CPU).
If the "zero + offset" XYZ axis creeps you can throw away your measurement.
And you should check if the IMU is bad or whatever else causes the deviation.
Otherwise you'd have to callibrate during the measurements.
I think sean pointed out the one of the 3 direction sensors is more susceptible to temperature, that's where things get rough. If nothing helps you could callibrate the IMU with temperature as a extra parameter. But that is something you'd rather avoid, since your calculation gets more complex. But the combination of an MPU925x and a BMP280 is a very logical one.
With temperature correction you hope to find:
current -/- ("zero + offset" + "temperature offset")
Again, easy in theory since the temperature offset is not constant.